Lord I'm learning so much more, than back when I knew it all.”


CakePHP scripts_for_layout

CakePHP

File this under CakePHP noob gotchas.

After several unsuccessful attempts to get the CakePHP Javascript helper to load two javascript files into a certain view on this site, my buddy Brit figured it out for me. I didn't have $scripts_for_layout in the layout file that page was using.

$javascript->link('my_script', false)

will make the script be in the document where you have placed the $scripts_for_layout tag in your layout file.

$javascript->link('my_script')

will make the script appear inline where ever you have placed the Javascript helper.

Leaving the boolean value of false off tells cakephp to put the reference exactly where you have it.




darrenfauth.com is built on the Codeigniter MVC framework and using the Blueprint CSS framework for layout.