I want to make the accessing to the contoller PostController::showAction, only from this url: https://localhost/blog/post/:id/:title and not from https://localhost/blog/post/show
So I did this to my router:
$di->set("router", function(){
$router = new \Phalcon\Mvc\Router();
$router->add(
"/post/([0-9]+)/([a-zA-Z0-9\+\_\-]+)",
array(
"controller" => "post",
"action" => "show",
"id" => 1,
"title" => 2
)
);
return $router;
});
But it still can be accessed from the unwanted url (https://localhost/blog/post/show) I think that the router should do this restriction, how ?