Register Assets (.js and .css) for a single page inside your controller file?
Permalink
I'd like to register/load .js and .css files only for my single pages so as not to load these plugins for the entire site. I see how it's done in the /themes/myTheme/page_themes.php dir but how would one make this happen in the controller for a single page. "addHeaderItem" is now bad practice. I have my javascript inside of "../applications/js" and my css in "../applications/css"
Would like to create an alias (where would that be done) and register them in the controller much like:
Would appreciate any help.
Thanks
Would like to create an alias (where would that be done) and register them in the controller much like:
public function registerAssets() { $this->registerAsset('css', 'video-js'); $this->registerAsset('javascript', 'video'); }
Would appreciate any help.
Thanks
I just had the same "problem".
I ended up adding the lines
In the
I can't say if it is best practise, but it worked for me :)
Regards,
Nicolai