Tuesday, December 14, 2010

CakePHP Component Re-Directs Revisited

In a previous post:
http://j-query.blogspot.com/2010/11/component-based-re-directs-in-cakephp.html

We discussed what was needed to get redirects working from a component.

In this post I will mention a simple bug that can come into a component that will really mess with all your re-directs. The problem is if your component extends Component instead of Object and you don't explicitly extend beforeRedirect(), for whatever reason all redirects on your site will result in infinite loops.

So the moral of the story:

Components extend Object not Component!