I have these two file in my project that I am migrating from php. I have developed most of it by seeing the functionality but there are these two files which I don’t know about. If somebody could have a look and help me converting these, I would really be thankful.
Menu.ctp
<?php
Configure::write('debug', 0);
echo($_GET['callback'].'(');
echo ($javascript->object($profiles));
echo(');');
?>
Retrieve.ctp
<?php
Configure::write('debug', 0);
echo($_GET['callback'].'(');
echo ($javascript->object($profile));
echo(');');
?>
This tell application to put debug mode to off. If you in debug mode, any application error message will be displayed which is not appropiate for production or ajax call.
$_GET is a global variable which hold all GET request parameter. For example, request to index.php?callback=some_callback will set $_GET[‘callback’] to some_callback.
This is javascript helper in CakePHP which turn PHP array($profiles) into JSON.
This will otuput :
callback_parameter(JSON form of profiles);