Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
two templates one controller
  • I'd like to use two templates or more into one controller, is it possible?
  • Using Controller_Template I assume? Not a problem, in your method you can just assign a new View to $this->template. Note that if you had assigned variables to the old template in your before() method, those will be lost.
  • I'm not too sure how to assign a new view to $this->template, I tried $this->template = 'dashboard', dashboard is the name of my template. But it seems no being the good way. edit: found out $this->template = \View::forge('dashboard');
  • Correct. If $this->template is a string, the Controller_Template's before() method will convert it into a View object for you, but that only works for the initial template.
  • That work nicely thanks Harro

Howdy, Stranger!

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

In this Discussion