-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL segment constraints #6
Comments
That's an excellent idea. Are there other params like that? :string, I'm guessing? |
:string would be a bit too broad I guess, since practically anything can be a string... I'd go with :alpha You can read up on CI's routing options here |
Thanks, this is helpful. Will look through their routing system to get a better idea about how Freeway can work. |
I did a little bit of thinking and since you need a segment name to use for the {freeway_{name}} variables, you'd have to add the contraints to it. Something like this:
Or even incorporate a regex pattern: `product/{{product_id:(\d+)}}`` – Wouter |
Interesting. My original thought would be that if segments had restrictions or special parameters like that, they would look more like:
Seems more idiomatic to EE, and provides more flexibility for future features. |
Adding this here because I think it also falls underneath URL segment constraints: Currently the following route: will match a URL of /testroute, but it will also match /testroute2. Possibly regex anchors could be used to specify the beginning and end of the route to be matched? In my mind my route would end up looking like: ^/testroute/$ => / |
Weird — thanks for catching that oversight. Will make sure to anchor the segments between ^ and $. |
Hi Doug,
Very nice extension and I can't wait to dig in (when I have a need for it), but there's one thing I'm missing compared to 'normal' routes in CI.
With CI routes you can do something like this:
`$route['product/(:num)'] = "catalog/product_lookup_by_id/$1";``
Which basically says that the 2nd segment has to be a number. Is there any way to incorporate this in Freeway?
– Wouter
The text was updated successfully, but these errors were encountered: