-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
URI Routing issues #278
Comments
But - sure - a full error log wouldn't hurt. |
… ensure a conforming URL. Partial for #278
Looking closer at your second examples - that's not an error. You should have to specify the full class name of the controller, it's the only way to ensure you're targeting the appropriate class. With the change I just pushed, it should give a trailing slash on that now. I'll look at the docs and try to clarify. |
Okay, thanks for clarification on full class names! |
Issue
The behaviour of URI routing
route_to()
function doesn't match (bug?) what is said in documentation.Relative / absolute ?
First, it says "Generate the relative URL to link[..]", but documentation example code shows it returns an absolute path, e.g. "Generates: **/users/**15/gallery/12[...]". I'm talking just about the leading slash.
Should it return with leading slash, as documentation says or should it return without leading slash, as it is currently happening?
I feel like it should return always with leading slash, because when navigating, you can go recursively and end up at e.g.
/users/users/users/1/
and so on.Reverse routing
Second, the reverse URL finding works for me if I only feed the route's
as
parameter to theroute_to()
function.Example code
Here's my example code:
Route Config (application/Config/Routes.php)
Example 1 (feeding route 'as' parameter)
In view file I write:
It generates URL without leading slash:
Example 2 (feeding route method)
In view file I write:
It generates error:
EDIT: Example 2 that works
Write in view file
Generates URL without leading slash
I can post full error log if its necessary.
I didn't find any similar issues or pull requests, tested it on latest
develop
branch as of current, with PHP version 7.0.10, under OS X El Capitan and macOS Sierra.The text was updated successfully, but these errors were encountered: