Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Asset module path with Theme
  • Hi,

    I want to use Theme class for my module, in my config i'have set 
    'assets_folder' => 'themes',
    'use_modules' => true,

    Now in my module controller, i want to load a css file from module, but what's the path if "use_module" is enabled ?

    I want to store my css like that : "public/themes/default/modules/<name>/css/file.css"
  • It will be: "public/themes/default/<name>/css/file.css".

    If you define it as

    'use_modules' => 'modules',

    It will be: "public/themes/default/modules/<name>/css/file.css".

  • I've put my css file in "public/themes/default/<name>/css/" 

    And in my module controller, action before : 
            $this->theme = \Theme::instance();
            $this->theme->asset->css('test.css');

    I've this error : Could not find asset: test.css

    But if i put test.css in "public/themes/default/css/", it's work.



  • Ah, wait a sec.

    use_modules only works for view files. It is a Theme setting. Asset resolving happens in the Asset class, which is not aware of modules.
  • Okay, thanks i see better.

    for my module i think i will put asset files in "public/themes/default/css/modules/<name>/" and i will use 
    $this->theme->asset->css('modules/<name>/test.css")

  • HarroHarro
    Accepted Answer
    It would be handy if assets would become module aware. I'll see if I can find some time for that.

Howdy, Stranger!

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

In this Discussion