Fed up of writing $this->layout = ‘admin’ in all the admin methods of your controllers? Me too. I realised that instead you could automatically set them in the beforeFilter() of your app_controller instead. 1 2 3 4 5 6 7 8 9 10 11 12 13 function beforeFilter(){ if(isset($this->params[’prefix’])) { //read the admin prefix [...]
Posts under ‘CakePHP’
At last the CakePHP books have arrived
I’d like to say it never rains but it pours, but that would be entirely the wrong sentiment, I need something more like good things come to those who wait… Anyway after an epic wait a flurry of CakePHP books have arrived. details on Amazon details on Amazon details on Amazon view at Manning I [...]
XAMPP and the PHP CLI
Like a lot of people I do most of my development work on windows PC and locally run a web a server and database. Like a a lot of people I just downloaded and installed a server bundle. For the last few years I have used Apache2triad and it has generally been pretty painless, but [...]
Displaying Auth Error Messages
I feel a bit daft posting this because in the end the answer was so easy to find – but maybe it will help somebody else. I’ve been re-writing my users / groups permission system for CakePHP 1.2 and decided to incorporate as much built in functionality as possible so I’m using the Auth Component [...]
CakePHP Calendar Helper
About six months ago I wrote a post about a Simple PHP calendar function I had written and how it was also really easy to use as a CakePHP helper. I didn’t actually write the calendar specifically with Cake in mind, but I was working on a Cake site at the same time and I [...]

