Including CSS Stylesheet Link from View CakePHP Version Gotcha

Written by James McDonald

March 17, 2014

Just ran into a version problem where my devel environment was running a cakephp version ahead of my live

In cake 2.4.1 this works:

// in layout
   echo $this->fetch('css');

// in view
    array('block' => 'css')

But in 2.3.1 you have to do this:

//same thing in layout as above 

// this in view
// you can put this options array
// strait into the css() block
$options = array(
  'inline' => false,
  'block' => 'css'

//notice this has three args
//the script file name as a file or 
// an array 
// 2nd arg is null
// then your options and html attribs.




Submit a Comment

Your email address will not be published. Required fields are marked *

You May Also Like…

Scam call from “Telstra”

Just had a call from a man with a sub-continental accent from caller ID 0734946596 Told me there was problem with my...

PC Build

I recently built myself a PC using the SilverStone SG13 Case. I am planning to use it as a Hot Spare. So any client...