Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
changing title and some property is complex
  • to set title of a page in partial, i have to write in this way

    $this->theme->set_partial('header', 'header')
                 ->set('title',$this->title)
                 ->set('assets',$this->assets);

    working fine, as title and assets are defined, [assets is asset path url]

    but how can change title variable in every page, i reccomend changing $this->title before executing set_partial is better.

    How i do that.. i want to change parent variable in before() by child class.
  • set_partial() takes either a string or a View object, and if you need access to the View object, you can use get_partial().

    So you can do:

    // define the partial
    $this->theme->set_partial('header', 'header');

    // and later assign some variables
    $this->theme->get_partial('header', 'header')
                 ->set('title',$this->title)
                 ->set('assets',$this->assets);
  • assets are not changing at every pages, it is same for a theme,

    any possibility that i can change title by assinging title to $this->title = 'Dashboard';


    any possibility
  • A theme is nothing more than a collection of View objects. So get the correct View object and set the title on it. I gave an example in my previous post for a partial, but you can do the same for a template using get_template().

Howdy, Stranger!

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

In this Discussion