In order to call CakePHP from non-CakePHP code, we will copy index.php from /app/webroot and put it into our non-CakePHP codebase as cakephp.php.
Then, we’ll create a function requestCakePHP that requires the cakephp.php file:
// Set the url parameter for cakephp
$_GET['url'] = $url;
// Fire up CakePHP and buffer results
$Dispatcher= new Dispatcher ();
Then, whenever we need to call for some Cake, we just call requestCake with the URL minus the hostname:
In the example above, I have a webpages controller, a view action and am viewing webpage #2.