I’ve been using the the Meio Upload Behaviour for a while as its a very handy piece of code, but as is so often the case it doesn’t do quite what I need. In the past I’ve got round this by hacking together a kind of supporting framework in app_controller and scattered about in my [...]
Posts under ‘CakePHP’
New business directory seeks businesses
I’ve been working on a business directory website in my spare time for a while and it is now live. The directory is www.blinks.org.uk and is for for companies / organisations / individuals based in the UK who want to promote their businesses. It is totally free to register and you won’t find any registration [...]
Overload $this->tags & $this->map in Apphelper
CakePHP is full of amazingly handy little bits and pieces, the trick is discovering them by exploring the API or paying attention to people who know Cake inside out.
AppHelper sits there begging to be filled, the idea being that you can overload core helper methods here; however there is a lot of debate as to [...]
Don’t add a component twice
Last week I spent an annoyingly long time tracking down a bug caused by what was basically a simple typo.
I discovered that my controller redirects (e.g. $this->redirect(array(‘action’=>’index’)); )were failing, but without generating any errors at all (that I could find).
Eventually I tracked down the cause by just taking the whole controller apart and [...]
Setting the ‘admin’ path using $html->link
Usually CakePHP can work out when link needs to be within the /admin/ section of your site. Sometimes however it needs a little help. When this happens you need to add ‘admin’ => true to the list of parameters.
1
2
echo $html->link($data[’SomeModel’][’name’], array( ‘controller’ => ’some_controller’, ‘action’ => ‘index’, ‘admin’ => true));