-
Notifications
You must be signed in to change notification settings - Fork 11.5k
[5.0] Normalize view names with namespaces with slashes properly #5763
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
[5.0] Normalize view names with namespaces with slashes properly #5763
Conversation
Had to move HINT_PATH_DELIMITER to the ViewFinderInterface. static::HINT_PATH_DELIMITER still works. http://3v4l.org/Z616Z
I don't see much advantage on allowing it to be configurable. From a package developer perspective, we already following the default |
Good point, I agree. |
How often is it used? Even worth having it as a constant? |
Well, both the |
I figured since it can't be changed why not hard code it in. What's the benefits of keeping it as a constant? Only thing I can think of is if someone were to implement their own finder and they want to use the constant in case it were to ever change, for whatever reason. |
|
||
list($namespace, $name) = explode($delimiter, $name); | ||
|
||
return $namespace . $delimiter . str_replace('/', '.', $name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll beat our man @GrahamCampbell to it. No need for the spaces when concatenating. 👼
Constants are great, man. Even if in theory |
👍 |
[5.0] Normalize view names with namespaces with slashes properly
This is nice. Could this be done to anything that uses namespaces: configs and lang? |
I don't think so, because in config/lang files there can be multidimensional arrays. For example... |
This is also why I'd prefer slashes over dots - it's more consistent with config/lang file behaviour. |
EDIT: Disregard, I see you don't normalize the namespace with dots. This would be for the namespace for consistency. |
Had to move
const HINT_PATH_DELIMITER
to theViewFinderInterface
.static::HINT_PATH_DELIMITER
in classes implementing the interface still works. http://3v4l.org/Z616ZThis does prevent end users from defining their own namespace delimiter. We could make a method
ViewFinderInterface->getDelimiter()
method instead. Thoughts?Ref #5756 (comment)