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
Multiple Themes
bernhardh
August 2013
How can I create multiple themes (for example one theme for logged in users and one for others)?
In the config file, there is only place for one theme to be defined.
If I want to use another theme, I have to call:
$this->theme = \Theme::instance(
'extern',
array(
'active' => 'extern',
'view_ext' => '.twig',
'paths' => array(
APPPATH.'themes',
)
)
);
But I don't want to add these options every time I use this second theme!
Harro
August 2013
Accepted Answer
The config file contains the default/active theme and the fallback theme.
You can alter the active theme using
Theme::instance()->active('extern');
or fallback using
Theme::instance()->fallback('yourfallbacktheme');
or if you already have an instance,
$this->theme->active('extern');
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,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
August 2013