I want to make multi-template project and try to use Asset class in advanced mode as separate instances.
When I try use static class, it works ok: - In base controller - Asset::add_path('assets/face/'); Asset::css('style.css', array(), 'face');
- In view - <?=Asset::render('face')?>
But when I try use instance of class, something goes wrong: - In base controller - $asset = Asset::forge('face', array('paths' => 'assets/face/')); $asset->css('style.css', array(), 'facegrp');
- In view - <?=Asset::instance('face')->render('facegrp')?>
In the last way I get the error: Fuel\Core\FuelException [ Error ]: Could not find asset: style.css
Can you help me to understand, what do I do wrong? Thanks.
PS: The style file style.css is placed in assets/face/css/.
Ok. I decided to approach the issue seriously and installed the netbeans with xdebug :) I find out that Asset::forge('face', array('patths' => 'assets/face/')) has no effect I expected. No new path was added. I don't known is it a bug or I don't understand all of the developers plans for this config parameter, but I also find out that $asset->add_path('asset/face/) works good like as Asset::add_path('asset/face/') with static version.
I am satisfied with that, but maybe Asset::forge has a bug, what do you think about it?