Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Issue about Theme and HMVC Request
  • Hi,

    I use Theme for my project. Here is my template controller : http://bin.fuelphp.com/snippet/view/BP

    My action widget : 
        public function get_widget()
        {
            if (\Request::is_hmvc())
            {
                return \View::forge('backend/widget')->set($this->data);
            }
        }


    When i do this in an action : 

            $this->theme->get_template()->set('pageTitle', __('url.title.manage_all'));
            \Debug::dump($this->theme->get_template()->get('pageTitle'));
            $this->data['widget'] = \Request::forge('url/backend/index/widget', false)->execute();
            \Debug::dump($this->theme->get_template()->get('pageTitle'));


    The 1st dump show the pageTitle, but the second return error :
    OutOfBoundsException [ Error ]:
    View variable is not set: pageTitle

    Why the HMVC Request re-initialize all my template vars ?
  • HarroHarro
    Accepted Answer
    It looks like that HMVC call redefines your template? That will load the View again, making you loose all variables.

Howdy, Stranger!

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

In this Discussion