-
Notifications
You must be signed in to change notification settings - Fork 324
Description
Hi,
Currently we have (./system/classes/Kohana/Request.php:974)
// These are accessible as public vars and can be overloaded
unset($params['controller'], $params['action'], $params['directory']);
Eg. the situation with a numerous routes, where some of them require action to be explicitly supplied, while others do not, and some of them even do not have such parameter in their regex, just implied one.
Next, we are going to create canonic url for every page. Not having explicitly supplied action (as an example, the same for controller too, not sure about directory but likely it is quite similar) in params received via $p = $this->request->param() we need to make a certain efforts to supply all required route params when further calling $this->request->route()->uri($p) to avoid getting an exception Required route parameter not passed: action...
Well, when there are just a few routes it could be ok, but with routes amount increase it get even more difficult to supply all that...
Adding action to params array $p['action'] = $this->request->action() before calling ...->route()->uri($p) is not very good too, because we can want some URIs not having it...
As for me, if any of these parameters was explicitly supplied in URI then we need to leave it in params array as well.
Any opinions?
Thanks