Re: Route : defaut action for a controller

2006-09-28 Thread AD7six
This conversation seems much bigger than the problem being discussed :) Why not Define one route for /galleries/ (that uses the method index or whatever you want to call it) Define one route for /galleries/history/* (that uses the method history) Define one route for /galleries/* (that calls the

Re: Route : defaut action for a controller

2006-09-28 Thread [EMAIL PROTECTED]
xOrster: what a user want's to have a gallery named "list" ? what then? I think it's not a good way to define the second url parameter as a method parameter I think the best way would be something like http://host/galleries/gallery/foo but I know it would be better your way, is just you are limi

Re: Route : defaut action for a controller

2006-09-27 Thread x0rster
I took the blog example from the cakephp manual to explain what I want, but i'm not developping a blog but a web gallery, for example : I have 2 galleries : foo, and bar I want to access them from http://host/galleries/foo and http://host/galleries/bar If someone try something else like http://hos

Re: Route : defaut action for a controller

2006-09-27 Thread Brian French
Why would you want a catch-all? What would you want to do if someone hit http://localhost/blog/sumthin ? However, with the way that AD7six explained it, it should create your catch-all functionality. The bad thing is that you may have to define a route for every method in the blog controller t

Re: Route : defaut action for a controller

2006-09-27 Thread x0rster
Ok, thanks you AD7six So I need to add a route for each other members functions in BlogController. It's too bad that there is no way to define a route functionning like a "catch-all" if the function does not exist. Thanks for your help --~--~-~--~~~---~--~~ You r

Re: Route : defaut action for a controller

2006-09-27 Thread Vanchuck
I don't know if this can be done automatically just using a single route. If you want: http://host/blog/test => Blog->Index('test') BUT http://host/blog/history/2006 => Blog->History('2006') Then one thing you could do is hand over the routing logic to your BlogController's index function, by us

Re: Route : defaut action for a controller

2006-09-27 Thread Schinki
Ok, I think I didn´t understand your problem properly, xOrster! ;o) I didn´t know that you want all actions redirect to index, except "history". I think the answer by AD7six is right. I didn´t test it, but it sounds correct. Cheers. --~--~-~--~~~---~--~~ You rec

Re: Route : defaut action for a controller

2006-09-27 Thread Schinki
Ok, I think I didn´t understand your problem properly, xOrster! ;o) I didn´t know that you want all actions redirect to index, except "history". I think the answer by AD7six is right. I didn´t test it, but it sounds correct. Cheers. --~--~-~--~~~---~--~~ You rec

Re: Route : defaut action for a controller

2006-09-27 Thread AD7six
<< Google posting errors are a pain, the posts usually go through and I apologise in advance if this is a duplicate post >> Hi x0rster, I hope I can add some clarity :) > $Route->connect ('/blog/:action/*', array('controller'=>'Blog', 'action'=>'index')); This route says that the second paramet

Re: Route : defaut action for a controller

2006-09-26 Thread x0rster
Oups, Sorry I've got some problems with google groups server --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this

Re: Route : defaut action for a controller

2006-09-26 Thread x0rster
I will try to explain more precisely : I want that http://host/blog/test invoke index action of blog controller with "test" as a parameter to index function if test is not a member function of blog controller And if test is a function of blog controller, I want that test function is runned and no

Re: Route : defaut action for a controller

2006-09-26 Thread x0rster
I will try to explain more precisely : I want that http://host/blog/test invoke index action of blog controller with "test" as a parameter to index function if test is not a member function of blog controller And if test is a function of blog controller, I want that test function is runned and no

Re: Route : defaut action for a controller

2006-09-26 Thread x0rster
I will try to explain more precisely : I want that http://host/blog/test invoke index action of blog controller with "test" as a parameter to index function if test is not a member function of blog controller And if test is a function of blog controller, I want that test function is runned and no

Re: Route : defaut action for a controller

2006-09-26 Thread Schinki
Hi. I think, you don´t need to rewrite your Router. "index" is the default action, if no action is given. url: www.example.com/blog/ -> controller: blog, action: index Am i wrong or i can´t understand you? Cheers. --~--~-~--~~~---~--~~ You received this messag

Route : defaut action for a controller

2006-09-26 Thread x0rster
Hi, I'm trying to get this working (from the cake manual) : -- The following example joins all the urls in /blog to the BlogController. The default action will be BlogController::index(). $Route->connect ('/blog/:action/*', array('contr

Re: Route : defaut action for a controller

2006-09-26 Thread [EMAIL PROTECTED]
Sounds like what youa re wanting is a $Route->connect('/blog', array('controller'=>'Blog', 'action'=>'index')); You cannot using the :action and then also explicitly define the action. And if you didn't then you are just reverting back to the default behaviour. So, sounds like you just want th