Question

I want to assign an id to loaded CSS in CakePHP. How to assign the id to CSS using the CakePHP HTML helper?

While loading the single CSS:

echo $this->Html->css('......');

While loading multiple CSS:

$all_css = array('first', 'second', '....');
echo $this->Html->css($all_css);
Was it helpful?

Solution

loading a single css you can do

echo $this->Html->css('foo', array('id' => 'your_css_id'));

I don't know how to do this with multiple css (unless you want to set the same id to all the tags but I don't think it's your case)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top