Permission denied, cake bake console
November 6, 2010 by Ayo Akinyemi · Leave a Comment
If you are getting a permission denied error while trying to bake, remember to chmod +x on the console file in your cake folder. keep walking…
Multiple modal box on one page, cakePHP-jQuery
November 6, 2010 by Ayo Akinyemi · Leave a Comment
You must have installed jquery, called ajax helper in your controller and also call jquery in your layout Dynamically calling multiple modal box on a single page: In your view page, <?php echo $html->scriptStart() ?> $(function() { $(‘a#userinfoID’).click(function() { var uid = $(this).attr(‘userinfo’); $(‘#userdialog’ + uid).dialog(‘open’); return false; }); }); <?php echo $html->scriptEnd() ?> <?php [...]
cakePHP ‘created’ truncated to the date only
September 7, 2010 by Ayo Akinyemi · Leave a Comment
$this->yourTableName->find(“all”,array(‘conditions’ => array(‘yourTableName.id’ => $this->params['pass'][0], ‘DATE(yourTableName.created) ‘ => date(“Y-m-d”,strtotime(“-0 day”))))); ‘created’ DB column name in cakePHP has a datetime format. the code finds record using the date(“Y-m-d”) condition.
Submit button as image, CakePHP
August 6, 2010 by Ayo Akinyemi · Leave a Comment
echo $form->submit(‘submit’, array(‘type’ => ‘image’, ‘src’ =>$this->webroot . ‘img/myimage.jpg’, ‘height’ => ’15′, ‘width’ => ’15′)); or echo $form->end(‘myimage.jpg’); – no option to set the height or width, you’d have to put in css
CakePHP 1.3/PHP 5.3 ‘strtotime error’
June 29, 2010 by Ayo Akinyemi · Leave a Comment
Caking and getting a strtotime ? PHP Warning: strtotime(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function…blah blah blah In the file app/config/core.php, simply uncomment this line: date_default_timezone_set(‘UTC’); Error will disappear.
CakePHP 1.3 ‘No Such File’ Fix – Mac User
June 29, 2010 by Ayo Akinyemi · Leave a Comment
Method 1: Create a symbolic link (temporary) ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock This is temporary because the symlink is automatically deleted when MAMP deletes the temporary mysql.sock file. Method 2: Change MAMP’s configuration (permanent) Edit the following configuration files: /Applications/MAMP/bin/startMysql.sh and /Applications/MAMP/bin/stopMysql.sh Replace socket=/Applications/MAMP/tmp/mysql/mysql.sock with socket=/tmp/mysql.sock Important: Now shut your server down and start it back [...]
Requested File Not Found – WAMP + CAKEPHP
April 17, 2010 by Ayo Akinyemi · Leave a Comment
If you are using WAMP + CAKEPHP for your development and you localhost returns a “requested page not found” on your server, you probably have your rewrite_module turned off. Click on the wampserver2 icon on your task bar and locate “Apache Modules”, you’d see one called rewrite_module, click it and restart your service.
