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…

Useful hidden functions


There are some handy cake functions you might not have used or even heard of, yet. Debugging Most beginners use print_r() to debug variables. Without <pre> tags its really hard to read, though. Use pr($var) or debug($var) to debug this…

User Add Console Script


If you have a fresh setup of your app and no users in the database, its not easy to "register" a new one (with the admin role and everything). The other case would be if you changed the security salt….

Code-Completion Console Script


Many good IDEs for Webdevelopment cannot automatically understand the structure of a framework and its classes/objects. They need a small file initializing the objects so that they know in which context they appear. E.g.: $this->Session (Session Helper) its impossible for…

Helper? Component? Lib?


Some ideas what to use if you want to add some additional feature. Feel free to comment on this below. Level of Independence We need to ask ourselves if this feature needs to interact with other cake elements, like controller,…

Working with forms


The Cookbook only covers the real basics. I want to go over some common issues in a more detailed way for Cake1.3 apps. Dummy Values Dummy values for select fields are usually added in the view: /* (1) */ echo…

Cake Bake: Custom Templates


The Problem The default templates of the "baking" process are not very useful for a productive environment. They are meant to rapidly produce working code for development purposes. This is actually great for that matter. But as soon as you…