Selectively load Javascript c5 ver 5.6

Permalink
Hi,

I am theming using ver 5.6 and would like to selectively load css and js that is load certain js script & file and css only on certain page or page types.

Can anybuddy tell me how to achieve this the correct way.

Thanks
dk

 
hutman replied on at Permalink Reply
hutman
You can do something like this in the on_start function of your page type controller

$html = Loader::helper('html');
$this->addHeaderItem($html->javascript('jquery.ui.js'));
$this->addHeaderItem($html->css('jquery.ui.css'));