CakePHP – link / include JavaScript files in layouts
Create (or modify the) file add this code CakePHP 1.2 allows you to define a reference to a Javascript file which is then added to the head section of the generated code. For this purpose the variable $scripts_for_layout has to be added to the layout: In the view you can now link to the Javascript file with: