ORM type map details With the help of the Setup plugin you can get a lot of useful info for your current app setup. One very new useful overview is the ORM type map. It shows the different types and…
Tag: Tips
CakePHP Tips Summer 2019
This year I want to quickly put a few useful things out there again for you in terms of CakePHP development and ecosystem. CakePHP 4 preview Check out CakePHP 4 while it is still not RC (release candidate) and therefore…
CakePHP Tips 2017 Part 1
Whoops as ErrorHandler I recently switched to Whoops in my apps. It provides a better exception rendering for development mode for most cases. Just load the plugin (dereuromark/cakephp-whoops) and modify the bootstrap line: //(new ErrorHandler(Configure::consume(‘Error’)))->register(); (new \CakephpWhoops\Error\WhoopsHandler(Configure::consume(‘Error’)))->register(); If you already…
CakePHP Tips Winter 2016
This is literally my last blog post for the year 2016 🙂 Use the right DateTime typehint If you are passing DateTime objects around in CakePHP, they are usually Chronos objects, and either \Cake\I18n\Time or \Cake\I18n\FrozenTime then. Both those are…
CakePHP Tips Fall 2016
Always use proper version check method Be aware of version checks that are using the inferior and even wrong </> comparison. This can lead to wrong conditions with higher minor versions. I had this in my code from the early…
Use isset() and empty() wisely
This is another part of the series "How to write better PHP code". Sometimes it is the small things than can make all the difference. In this case simply using the correct way of checking for variable content can avoid…
CakePHP Tips 2015
Most tips are for 2.x and 3.x as they have been applied to both versions. Complex radio inputs A while back I posted a tip about deep array options for select input form fields. With my recent path for 2.6…
CakePHP 2.5 arrived + CakePHP Tips 2014
You probably read my last tip sections. And I started to move some of them to my sandbox app. But once in a while it might also be nice to publish a few selected tips, here as well. Oh, and…
CakePHP Tips – Summer 2013
While CakePHP 2.4 is now just around the corner (already beta), a few tips gathered the last few days. Don’t mix controller and component pagination Currently, if you mix controller pagination setup and call the Pagination component then, it can…
CakePHP Tips
All new CakePHP tips collected over the last few weeks. Dispatcher execution order Tested on Cake2.3RC: APP/webroot/index.php CORE/bootstrap.php APP/Config/core.php APP/Config/bootstrap.php dispatchers defined in CORE bootstrap APP/Config/routes.php APP/Config/database.php controller and all the rest It is important to know that the dispatchers…