Re: accessing a url param in a router

2007-04-08 Thread Zoltan
Ok, this is what I have now: Router::connect('/:id', array('controller' = 'places','action' = 'view'), array ('id' = '[a-z_0-9]{1,15}') ); The error I get is, if I enter something like: http://127.0.0.1:8084/edragon it thinks it's looking for a controller called Edragon: Missing controller

accessing a url param in a router

2007-03-24 Thread Zoltan
I'm sure this has been asked before, but I haven't be able to turn up the answer: I want to have a url like mysite/123 resolve to mysite/places/view/506 Using 1.2, I have a route like: Router::connect('/[0-9]+', array('controller' = 'places', 'action' = 'view', $this-params['url'] -- **doesn't

Re: accessing a url param in a router

2007-03-24 Thread Chowsapal
I'm not sure I know the best answer for this, but one thing you could do is: Router::connect('/:param_name', array('controller' = 'places', 'action' = 'view')); This will set $this-params['param_name'] to 123 or whatever is there. As far as limiting this to only numbers, or using info from the

Re: accessing a url param in a router

2007-03-24 Thread Zoltan
I found making this the last condition seems to do the trick, but I'm not sure if this is the proper way to do it: Router::connect('/[0-9]{1,4}', array('controller' = 'places','action' = 'view', $_GET['url'] )); Zoltan On Mar 24, 12:49 pm, Chowsapal [EMAIL PROTECTED] wrote: I'm not sure I

Re: accessing a url param in a router

2007-03-24 Thread nate
Yeah, that's not really how you're supposed to use it. See the example here: http://cake.insertdesignhere.com/posts/view/10 On Mar 24, 1:55 pm, Zoltan [EMAIL PROTECTED] wrote: I found making this the last condition seems to do the trick, but I'm not sure if this is the proper way to do it: