Add Controller
When users click on button ADD TO DO, Add To Do page which contains a form, user will fill information, submit form to create
their task, tasks will be shown into their to do list.
...
Look in to pasted code, you use _p function many times, what exactly _p do?
_p is a shortcut to call ../service/service-translation.md Translation translation service, which translate a phrase id
to language which selected by current logged in user. _p give a flexible, robust way allow developers/admin/translators modify message
translation on the fly.
...
Code Block | ||||
---|---|---|---|---|
| ||||
echo _p('Add To Do') //english print: To do name is required |
Translate method _p()
_p method used to translate a message into multiple language, the detail about translation will be explain later.
...
Go to + Add To Do page, full fill the form, then press submit, a new item will be added to database then user will be redirected to
to do list home page. The next chapter will guide you how to show to do list items from database.