Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Regarding presenter
  • Dear sir,

    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.

    Regardeds,
    Masao
  • HarroHarro
    Accepted Answer
    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).
  • Dear Harro,

    Thank you very much for quick response and good examples.

    I understand when to use presenter.

    I would be using presenter that way.

    Thanlk you,
    Masao

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion