How do you specify an HTTP status code in Cakephp?

EDIT – This question is quite old and covers different versions of the CakePHP framework. Following is a summary of which version each answer applies to. Don’t forget to vote on the solution that helps most. CakePHP 3.x and 4.x – using response object (Roberto’s answer) CakePHP 2.x – using exceptions (Brad Koch’s answer) [preferred … Read more

What is a .ctp file used for in CakePHP?

CakePHP 1.2 introduced .ctp as its file extension for views. CakePHP view files are written in plain PHP and have a default extension of .ctp (CakePHP Template). These files contain all the presentational logic needed to get the data it received from the controller in a format that is ready for the audience you’re serving … Read more

What is the equivalent to getLastInsertId() in Cakephp?

CakePHP has two methods for getting the last inserted id: Model::getLastInsertID() and Model::getInsertID(). Actually these methods are identical so it really doesn’t matter which method you use. echo $this->ModelName->getInsertID(); echo $this->ModelName->getLastInsertID(); This methods can be found in cake/libs/model/model.php on line 2768

symfony vs cakephp [closed]

Just to balance out this thread, this is why I like symfony: uses PHP5 it runs some really big sites like Yahoo! Answers, delicious, and Daily Motion. good documentation. the jobeet tutorial on the website is awesome. walks you straight through all of the features, and after you are done you feel like you can … Read more

CakePHP 3.0 installation: intl extension missing from system

I faced the same problem today. You need to enable the intl PHP extension in your PHP configuration (.ini). Solution Xampp (Windows) Open /xampp/php/php.ini Change ;extension=php_intl.dll to extension=php_intl.dll (remove the semicolon) Copy all the /xampp/php/ic*.dll files to /xampp/apache/bin Restart apache in the Xampp control panel Solution Linux (thanks to Annamalai Somasundaram) Install the php5-intl extension … Read more