Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
changing title and some property is complex
ashizakp
September 2015
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.
Harro
September 2015
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);
ashizakp
September 2015
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
Harro
September 2015
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().
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,089
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
261
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
ashizakp
September 2015
Harro
September 2015