Most beginners use "http://localhost/…/app/ for their project when they develop locally. This can have several possible downsides if not carefully avoided. Especially with (hardcoded) paths in css, js, images or any other browser url related issue. So the better way…
Year: 2011
Cakephp Console on Linux systems
You could hard-wire the Cake path into the environment. With multiple cake core versions on a single system, sometimes it is better not to do that, though. So I just follow the following guidelines: Only add the PHP path to…
Unit-Testing in CakePHP
Warning: Some information my be deprecated! This is still from 1.3 and SimpleTest. CakePHP now uses PHPUnit in 2.x – please see the updated article here. Some tips you might not have read about yet Since the cookbook is quite…
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…
Working with models
Since there is so much to talk about it here, I will cut right to the chase. We all know about "Fat Models, Slim Controllers". So basically, as much as possible of the code should be in the model. For…
Web Development Snippets
A couple of useful snippets for web developing. The list will grow over the years. Jumping to anchors with JS If we want to jump to an anchor dynamically (using javascript): /* dont use this!!! */ //location.href = location.href +…
Is your website IPv6 ready?
Is your (CakePHP) website ready for the new protocol version? Some time this year your provider will probably change to IPv6. Usually it will then provide both. Why now? Due to the IPv4 exhaustion it is now time to act….
Useful PHP coding tips
I hope the following tips help some of the newer php coders and prevent errors I either had to face or did myself. Don’t use private attributes/methods without a good reason There are some libs or classes that use private…
Widgets and CSRF – How To
Outline Did you ever try to create a widget like "Facebook Like Box" or whatever for your website? Did you try to include it in a foreign page with some JS code? If you use iframes, this is trivial. But…
Enrich your website with Rich Snippets
Why? For details see the Google info page. One nice effect is the rating (displayed as yellow stars) in the search result: Microformat, Microdata, RDFa, …? Many new formats, many different styles. There are so many because they have been…