On Google Groups you read about some problems over and over. So i thought, why not putting the most frequent ones together. Add/Edit Post Url If you have an url like "/products/add/import:1/manufacturer:4" and you want to preserve the url on…
Month: October 2010
About PHP basics and pitfalls
AND, && and & Usually you use && in favor of AND. At least, I prefer! Cake code conventions state the same. But they do exactly the same: They "intelligently" match the conditions and abort as SOON as the first…
Complete CakePHP naming conventions
For details into some aspects take a look at my old "coding standards" summary. Database Database tables are plural: "comments" or "user_comments" etc. I recommend to stick to conventions and underscore + lowercase all table fields: "last_login" (instead of "lastLogin"…
CakePHP Beginner Tips
Based on CakePHP1.x. Valid for 2.x (see updates below). Apache Server For Windows use WAMPServer2 and select "Apache" => "Apache Modules" => "rewrite_module". Thats all there is. Cake should now work out of the box without any other modifications. Database…
CakePHP Security
When I first started with CakePHP I didn’t know about those things, either. Everything was new and I was overwhelmed by all the functionality of the framework. The basic rule is: Validate input, escape/sanitize output Input I already wrote an…
Console for CakePHP
A Cake 2.x warning: Read the bottom part ("Hot Tip") – and do NOT add Cake to the system path anymore. Windows and CakePHP 1.x Nothing easier than that! 2 minutes and it works. I prefer WAMP (XAMPP sucks). But…
Behaviors in CakePHP
I didn’t use behaviors for the first 12 months with Cake. I regret it now, because the code is no much cleaner and easier to extend. Let’s make a test with a simple task. We need some additional statistics to…