I am creating a generic search for my app and am trying to use "router" to generate something like "/search/anything+here" I'm doing it this way:
$di->set('router', function(){
$router = new \Phalcon\Mvc\Router();
$router->add(
"/search/{term:[a-zA-Z_]+}",
array(
"controller" => "search",
"action" => "search",
)
);
return $router;
});
In SearchController I try this
public function searchAction()
{
$term = $this->dispatcher->getParam("term");
$this->log->log($term);
}
Thus I can only get the parameter {term} if only with a simple word like "anything" if I use "anything+here" or "anything here" the router is ignored.
I do not know if I was clear on the issue.