Re: Trouble with the Router
On 5/13/07, Chris Hartjes <[EMAIL PROTECTED]> wrote: > On 5/13/07, Aaron Shafovaloff <[EMAIL PROTECTED]> wrote: > > > > Here are the routes that got it working: > > > > http://bin.cakephp.org/view/1621988238 > > > > Crucial to it working was me sending an empty string (instead of null) > > as the "action" parameter to Router::url > > > > Tip of the hat goes to PhpNut for the help. And the money, as he > > requested, goes to the Cake Software Foundation. > > > > Well done Larry. > To follow this up, could it be explained HOW what Larry suggested works because I imagine custom routing questions come up all the time. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Trouble with the Router
On 5/13/07, Aaron Shafovaloff <[EMAIL PROTECTED]> wrote: > > Here are the routes that got it working: > > http://bin.cakephp.org/view/1621988238 > > Crucial to it working was me sending an empty string (instead of null) > as the "action" parameter to Router::url > > Tip of the hat goes to PhpNut for the help. And the money, as he > requested, goes to the Cake Software Foundation. > Well done Larry. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Trouble with the Router
Here are the routes that got it working: http://bin.cakephp.org/view/1621988238 Crucial to it working was me sending an empty string (instead of null) as the "action" parameter to Router::url Tip of the hat goes to PhpNut for the help. And the money, as he requested, goes to the Cake Software Foundation. On May 13, 8:52 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On 5/13/07, Aaron Shafovaloff <[EMAIL PROTECTED]> wrote: > > > > > I extensively use Router::url in my application. I'd hope I could use > > some sort of regular expression or option in the usage of Router::url > > without afterwards modifying what Router::url returns. > > > $5 to anyone who can help me with this problem :-) > > You are trying to alter a fundamental behaviour of pretty much any > routing system in a Model-View-Controller based framework. If there > are any frameworks that behave exactly the way you need, I'd love to > see how they are doing it. > > The default action for any controller is 'index', unless you configure > it otherwise. It's a convention of the system. If you set it to > 'null', it's going to fall back to the rules of the system itself, > which says 'index' is the action and it will happily return the URL > with 'index' or whatever else is the default action in it. > > When you ask it to give you the URL that represents the default action > for a controller, well, it's going to tell you whatever the convention > is or whatever you've told it you want it to be. Don't want URL's > with 'index' in them? Then you can't ask CakePHP to generate the URL > for you. You'll have to do them by hand. > > If I am wrong, I'm sure others are rubbing their hands in glee at a > chance to point out the mistakes of the Grumpy Old Man of the List. > > -- > Chris Hartjes > > My motto for 2007: "Just build it, damnit!" > > @TheBallpark -http://www.littlehart.net/attheballpark > @TheKeyboard -http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Trouble with the Router
On 5/13/07, Aaron Shafovaloff <[EMAIL PROTECTED]> wrote: > > I extensively use Router::url in my application. I'd hope I could use > some sort of regular expression or option in the usage of Router::url > without afterwards modifying what Router::url returns. > > $5 to anyone who can help me with this problem :-) > You are trying to alter a fundamental behaviour of pretty much any routing system in a Model-View-Controller based framework. If there are any frameworks that behave exactly the way you need, I'd love to see how they are doing it. The default action for any controller is 'index', unless you configure it otherwise. It's a convention of the system. If you set it to 'null', it's going to fall back to the rules of the system itself, which says 'index' is the action and it will happily return the URL with 'index' or whatever else is the default action in it. When you ask it to give you the URL that represents the default action for a controller, well, it's going to tell you whatever the convention is or whatever you've told it you want it to be. Don't want URL's with 'index' in them? Then you can't ask CakePHP to generate the URL for you. You'll have to do them by hand. If I am wrong, I'm sure others are rubbing their hands in glee at a chance to point out the mistakes of the Grumpy Old Man of the List. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheBallpark - http://www.littlehart.net/attheballpark @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Trouble with the Router
Here are some relevant CakeBin pastes: http://bin.cakephp.org/view/1593972132 http://bin.cakephp.org/view/1098672765 When I uncomment the pr($url), I get this: http://bin.cakephp.org/view/706088071 On May 13, 8:27 pm, Aaron Shafovaloff <[EMAIL PROTECTED]> wrote: > I extensively use Router::url in my application. I'd hope I could use > some sort of regular expression or option in the usage of Router::url > without afterwards modifying what Router::url returns. > > $5 to anyone who can help me with this problem :-) > > On May 13, 8:04 pm, Aaron Shafovaloff <[EMAIL PROTECTED]> wrote: > > > The following seems to force whatever action I'm currently using into > > the url returned by Router::url. > > > Router::connect('/:group/:controller/:action/*', > > array('action'=>null), array('controller' => 'curriculum|courses| > > facilitators|configuration')); > > > I thought array('action'=>null) would make the action optional? > > > If I change it to: > > > Router::connect('/:group/:controller/:action/*', > > array('action'=>'index'), array('controller' => 'curriculum|courses| > > facilitators|configuration')); > > > ... it, as expected, defaults the action to 'index'. But here's the > > thing: I'd only like the action to be visible in the url when it's > > *not* 'index'. Any ideas? --~--~-~--~~~---~--~~ 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 group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Trouble with the Router
I extensively use Router::url in my application. I'd hope I could use some sort of regular expression or option in the usage of Router::url without afterwards modifying what Router::url returns. $5 to anyone who can help me with this problem :-) On May 13, 8:04 pm, Aaron Shafovaloff <[EMAIL PROTECTED]> wrote: > The following seems to force whatever action I'm currently using into > the url returned by Router::url. > > Router::connect('/:group/:controller/:action/*', > array('action'=>null), array('controller' => 'curriculum|courses| > facilitators|configuration')); > > I thought array('action'=>null) would make the action optional? > > If I change it to: > > Router::connect('/:group/:controller/:action/*', > array('action'=>'index'), array('controller' => 'curriculum|courses| > facilitators|configuration')); > > ... it, as expected, defaults the action to 'index'. But here's the > thing: I'd only like the action to be visible in the url when it's > *not* 'index'. Any ideas? --~--~-~--~~~---~--~~ 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 group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---