Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Theme class and Template controller
  • Hi all,
    I'm trying to create some theme for my application, so it can be modified in less time. I have a problem with the theme: when I try to rendere the page, it doesn't found the views. I've downloaded the "Depot" project and I've noticed that all controller extend the Hybrid one, mine instead extends the Template one. Could it be the mistake? Because reading my configuration all seems to be ok...
  • Doesn't really matter. Depot extends Hybrid to allow REST methods in controllers, but that is not required. Where your views are searched depends on the configuration of the Theme class, there are quite a few options. But note that if you use Theme, you can no longer use View::forge().
  • Thanks Harro, but it seems to be something that I can't understand:
    - if I extend the Controller_Template controller, the application crashes because it searchs in the app/views/ folder
    - if I modified my controller to extend the base Controller, after insert a return::response all works well and the application searches the template in the correct theme folder. Are you sure theme can be used with Template controller? I create a new simple project but it doesn't work...
  • Yes. But as I said, the Theme class doesn't use standard View objects, which means that the standard $this->template in the Template controller is useless as well. Check the Depot code on how to work around that ( Controller_Base_Template::before() ).

Howdy, Stranger!

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

In this Discussion