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
Asset module path with Theme
Syntaxlb
January 2014
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"
Harro
January 2014
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".
Syntaxlb
January 2014
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.
Harro
January 2014
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.
Syntaxlb
January 2014
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")
Harro
January 2014
Accepted Answer
It would be handy if assets would become module aware. I'll see if I can find some time for that.
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
Harro
January 2014
Syntaxlb
January 2014