CakePHP Quick tip: Adding CSS links to $scripts_for_layout in 1.3
Got caught with this one upgrading from an older version of CakePHP to 1.3
In your view, to add a css file to the $script_for_layout variable, you used to do this:
<?php $html->css("css_file", null, array(), false); ?>
In 1.3, you have to change this to:
<?php $html->css("css_file", null, array("inline"=>false)); ?>
Must have glossed over that on in the CakePHP 1.3 migration guide.


Comments
In 1.3, helpers should really
In 1.3, helpers should really be accessed via the View's property rather than via the $helper variable in order to prevent collisions:
<?php $this->Html->css("css_file", null, array("inline"=>false)); ?>Thanks for the tip
Thanks for the tip :-)
Haven't really had much chance to play with 1.3 yet...
Thanks for the tip. Worked
Thanks for the tip. Worked exactly, but yeah, I included Karl's suggestion of $this->Html instead of just $html
Post new comment