Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
I have a question about presenter.
Should I always use presenter?
I want to know when to use presenter and when not use presenter.
I am sorry for that.
No, you don't have to.
In general, you would use a presenter if your view needs data that is not related to the request itself, is not generated by models, and would clutter the controller.
Think for example about:
- data lookups for columns in your models result that weren't returned
- lookups for sections of your page that are unrelated to the request (header or sidebar info)
If you have info you need to retrieve for every (or multiple) page, you can also create a base presenter for that, and have your page presenter extend that (like you do with controllers and models).
Thank you very much for quick response and good examples.
I understand when to use presenter.
I would be using presenter that way.
Add a Comment
It looks like you're new here. If you want to get involved, click one of these buttons!
Apply for Membership
↳ Job Board
↳ Installation & Setup
↳ Tips and Tutorials
↳ Code share
In this Discussion