Cutom Routes

2012-01-04 Thread Waterschaats
When a Controller of Plugin isn't found. I want it to end at a
specific controller that examines the ulr, and checks if there'r a
page related to it in my cms.
So, after the default cakephp routing I don't want the missing
controller error but I want to route to a controller.
How can I Accomplish this?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cutom Routes

2012-01-04 Thread DragonFlyEye
Waterschaats,

Have a look at the Error Controller:
http://book.cakephp.org/1.3/view/1188/Error-Handling

For more information on the types of pre-existing errors - including the 
missingController error, have a look at the API:
http://api.cakephp.org/class/error-handler#method-ErrorHandlermissingController

And remember: nothing says I know CakePHP like dipping your toes in the 
core-code waters!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cutom Routes

2012-01-04 Thread Waterschaats
Thanks this is usefull.
Although I was thinking of accomplishing this with Routes. It feels a
bit wrong to handle this with an error function. And is this
performance wise the best option?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cutom Routes

2012-01-04 Thread Waterschaats
by the way. I'm using cakephp 2.0 (The error handling implementation
has dramatically changed in 2.0)

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cutom Routes

2012-01-04 Thread DragonFlyEye
Considering that this is the way CakePHP handles errors, yes, it is 
certainly the most efficient option on its face. Others may dispute that.

I wouldn't really consider using Routes, because the routes are determined 
*before* the existence of any Controllers or Actions is confirmed. I do, 
however, have a catchall clause in my routes.php file that says:
Router::connect('/*', array('controller' = 'pages', 'action' = 
'display'));

This is basically in a situation where every other route is specified by 
the routes.php file. The reason for this is simply because so much of what 
my company wants to do in terms of routing has little to nothing to do with 
the way CakePHP wants to do things. If this helps you, go for it.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cutom Routes

2012-01-04 Thread DragonFlyEye
Ah, well, then I'm out of my element, Donnie. (Sorry for the Big Lebowski 
reference).

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cutom Routes

2012-01-04 Thread Waterschaats
Thanks,
In case of using: Router::connect('/*', array('controller' = 'pages',
'action' = 'display')); I have to specifie all the controller I use.
I don't want that.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php