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"…
Year: 2010
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…
Subversion and Git
They usually don’t play nice with each other. But what if we need a plugin/repository available for git AND for svn? The "new" way It used to work – but since a few weeks it doesn’t anymore. It WAS possible…
Useful Windows 7 Tricks
We all agree that Windows 7 is the most sophisticated version so far. WinXP is totally outdated, ME and Vista were crap. But despite the more stable workstation and some really good new features windows still lacks some basic stuff…
Setting up PHPDesigner for CakePHP
There are many great IDEs for PHP development. One is PHPDesigner, which is mainly for windows. With some minor adjustments it works pretty well with cake. Preferences Go to: Tools -> Preferences [CTRL + E] General File Encoding: UTF8 Trim…
Saving Model Data and Security
In google groups there are quite a few discussions every month about security against (primary key) injection, xss or other things. And yes, the default templates will not protect you from any of this. They are meant to produce quick…
External links and the target attribute
I like external pages to open in a new window. So that my page stays open. But target attribute is deprecated. If you want to validate the XHTML pages, it would result in errors. The thought behind it was to…