I prefer hyphen (-) in URLs, so I have to replace them before action is called.
Here's how to do this in 3.0.x
class Request extends Kohana_Request
{
public function execute()
{
$this->action = str_replace('-', '_', $this->action);
return parent::execute();
}
}
What is 3.x equivalent?
http://kohanaframework.org/3.1/guide/kohana/upgrading
Request::$action -> Request::action()
What are the best practices for this?
Should I overwrite that function, something like this?
class Request extends Kohana_Request
{
public function action($action = NULL)
{
$action = str_replace('-', '_', $action);
if ( ! $action)
return $this->_action;
$this->_action = (string) $action;
return $this;
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!