Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Multiple Themes
  • 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!
  • HarroHarro
    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');

Howdy, Stranger!

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

In this Discussion