Using CakePHP’s Bake on Linux

If you want to use CakePHP’s bake tool on Linux command line (like I have development environment on Linux) then you can ssh to your linux box as shown in the screen shot below

Linux Console

Second, you can execute the cake bake command in the following manner

./cake/console/cake bake

as shown in the picture below
Linux Console

CakePHP – link / include JavaScript files in layouts

Create (or modify the) file

app/app_controller.php

add this code

class AppController extends Controller {
	var $helpers = array('Html', 'Form', 'Javascript');
}

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:

<head>
	< ?php echo $scripts_for_layout; ?>
</head>

In the view you can now link to the Javascript file with:

$javascript->link('script.js', false);
// OR you can simply use $javascript->link('script.js');