Hi,
In regards to routing controllers with defined parameters, is there a way to default a parameter to something if it was empty?
Suppose you have the following:
$id = $this->dispatcher->getParam('id');
$page = $this->dispatcher->getParam('page');
which would then produce the result:
site.com/id/page
Assume afterwards, you were to do the following:
site.com/id
would there be a way to default the second parameter to let's say 1 if it was not defined? such as doing something like:
$page = $this->dispatcher->getParam('id');
if (!$page) {
return $this->response->redirect("idhere/1");
}
Any help would be appreciated. Thanks in advance.