I have 2 Module ! . Frontend vs Backend . Default is Frontend . My Route .
Important is I want hiding controller and action on url .
$di->set('router', function () {
$router = new Router();
$router->setDefaultModule("frontend");
$router->add('/:module[/]?:controller[/]?:action[/]?:params', array(
'module' => 1,
'controller' => 2,
'action' => 3,
'params' => 4
));
$router->add('/backend[:/]', array(
'module' => 'backend',
'controller' => 'index',
'action' => 'index',
));
return $router;
});
I want generate url like this .
https://localhost/backend <--- work
https://localhost/backend/ <--- not work
https://localhost/frontend/ <--- not work
Paginator url like this
Category url and pagination like this
https://localhost/category-name-is-here/
ex :
https://localhost/sports/ <---- category sports
https://localhost/sports/page/1 <---- category sports with paginattion
And URL friendly like this
https://localhost/i-want-to-make-url-friendly-like-this-p1.html <---- frontend-index-post
Someone help me