Crazy – because these tips are not used that often probably. But for some rare occasions they might come in handy. Inserting some rows into an array $array = array( 'one', 'two', 'three' ); $newValue = 'one-point-five'; //with 0 as…
Tag: Tips
Freshly baked Cake2.0 tips
With 2.0 there are many new features available. Some of them I want to introduce here. Using the console for 2.0 I once wrote about how to use the Cake1.3 console. The 2.0 shell is not so much different. The…
Very useful CakePHP Code Snippets
A small collection of useful Cake Snippets for all projects made with Cake. First of all: Keep it DRY If you have several projects I recommend extending vendor classes. require_once(VENDORS.'my_model.php'); class AppModel extends MyModel {} Same for AppController, AppHelper, bootstrap…
All new CakePHP Tips and Tricks
This is supposed to be a list of useful tricks gathered over many months. First Templates, then Bake, then Adjustments The usual workflow for a new project should be Create your custom templates Bake your crud actions using this very…
Frequent CakePHP problems and solutions
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…
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…
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…
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…
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…