Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Views example in docs returns error
  • Hello, example 1 of 'Nested Views' returns some errors for me. Everytime it is something like:
    ErrorException [ Notice ]: Undefined variable: site_title

    But if I try example 2, all works properly.
  • Philipp .... wrote on Thursday 30th of June 2011:
    Hello, example 1 of 'Nested Views' returns some errors for me. Everytime it is something like:
    ErrorException [ Notice ]: Undefined variable: site_title

    But if I try example 2, all works properly.

    Set global variable like this:
    $this->template->set_global('site_title', 'My site title');
    
  • Or use
    $data['header'] = View::factory('header', $data)->set('site_title', 'My site title')->render();
    
    Fact is that there's something not right. Either the docs need to be updated (in case nested views should not inherit variables) or the code should be fixed (in case inheritance is intended).

Howdy, Stranger!

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

In this Discussion