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…
Tag: CakePHP1.3
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…
Necessary Core Hacks – Cake1.3
As of now there are some litte adjustments that are either necessary or at least very useful to apply I keep this list here up to date and will remove or add hacks if something changes (usually the cake team…
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,…
Static Enums or “Semihardcoded Attributes”
There are many cases where an additional model + table + relation would be total overhead. Like those little "status", "level", "type", "color", "category" attributes. Often those attributes are implemented as "enums" in SQL – but cake doesn’t support them…
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…