Antony Male wrote on Wednesday 8th of June 2011:Thanks for the encouragement! I doubt they'll want to change anything in Fuel with a release on the way, but I might mention it once they get back onto feature-adding and Casset gets a bit more real-world experience.
Antony Male wrote on Wednesday 8th of June 2011:Aha I see. I hadn't noticed they did that. Regardless, I think I'll let it mature a little first.
Good luck and thanks for contribution
.. thanks again for your great contribution.A Huzz wrote on Saturday 11th of June 2011:I'm planning to use your library on my project and wondering how do you manage assets files in different locations for example mulitple theme dirs?
Antony Male wrote on Saturday 11th of June 2011:A Huzz wrote on Saturday 11th of June 2011:I'm planning to use your library on my project and wondering how do you manage assets files in different locations for example mulitple theme dirs?
Current it behaves exactly the same as Asset in this respect. You add the paths you want Casset to search through to the 'paths' config variable, and Casset will search through those and grab the first matching asset it finds. So in your instance you'd add "themes/default/" and "themes/admin/" to the paths array. I'm not entirely happy with this approach however (you're taking something that's nicely namespaced, and stripping all of that out -- what happens if you have two files called 'index.js' and want to include the second?). I'm entirely open to suggestions as to the best way to handle this.
A Huzz wrote on Saturday 11th of June 2011:thanks for your quick response, if you have identical files can you not place them with the same dir structure in the cache dir? so you will have cache/theme1/js/index.js and cache/theme2/index.js.
Casset::js('admin::index.js')
would work? I don't want the user to have to specify the whole path to the file -- including the 'js/' bit -- as Casset is able to work that out.'paths' => array( 'admin' => 'assets/themes/admin/' ),And then invoke this path with the syntax used above? What do you think?
Antony Male wrote on Saturday 11th of June 2011:A Huzz wrote on Saturday 11th of June 2011:thanks for your quick response, if you have identical files can you not place them with the same dir structure in the cache dir? so you will have cache/theme1/js/index.js and cache/theme2/index.js.
Currently, no. This is a flaw that the original Asset library shares. Check back on Monday, however, and I'll try and have something written in. Do you think a syntax likeCasset::js('admin::index.js')would work? I don't want the user to have to specify the whole path to the file -- including the 'js/' bit -- as Casset is able to work that out.
Maybe make the paths array associative, so you can specify this (in your config file)'paths' => array( 'admin' => 'assets/themes/admin/' ),And then invoke this path with the syntax used above? What do you think?
'groups' => array(
'css' => array(
'jquery-ui' => array(
'files' => array(
'jquery-ui.css',
),
'enabled' => true,
),
),
),
echo Casset::render_css();
Notice!
ErrorException [ Notice ]: Undefined index: jquery-ui.css
PKGPATH/casset/classes/casset.php @ line 194:
193: $parts = explode('::', $file, 2);
194: $path = static::$asset_paths[$parts[0]];
195: $file = $parts[1];
Casset::css('jquery-ui.css');
echo Casset::render_css();
Antony Male wrote on Wednesday 15th of June 2011:My bad, that was half a documentation omission since adding in namespacing, and half forgetting that people might want to specify un-namespaced files in groups in the config file. I've updated the docs and tweaked things so that your example now works (without modification). Thanks, and apologies,
Antony
'paths' => array( 'core' => 'assets/', 'uploadify' => 'assets/uploadify/' ),
'groups' => array(
'js' => array(
'uploadify' => array(
'files' => array(
'uploadify::file1.js',
'uploadify::file2.js',
),
'enabled' => true,
) ,
),
'css' => array(
'uploadify' => array(...),
),
),
'groups' => array(
'js' => array(
'uploadify' => array(
'files' => array(
'uploadify::*.js',
),
'enabled' => true,
) ,
),
'css' => array(
'uploadify' => array(...),
),
),
It looks like you're new here. If you want to get involved, click one of these buttons!