I have faced with a strange behaviour of getRewriteUri() method of the router.
instead of static url in paginator i put :
<li><?php echo $this->tag->linkTo([$this->router->getRewriteUri() . "?page=" . $page->next, "Next", "class" => "paginator", "id" => "next"]) ?></li>
insted of expected
/localhost/project/controller/search?page=3
i have got this one:
/localhost/project//controller/search?page=3 // <- note two shashes instead just one !!!!
the url service is registered in common way :
$di->setShared('url', function () {
$config = $this->getConfig();
$url = new UrlResolver();
$url->setBaseUri($config->application->baseUri);
return $url;
});
and $url->_base_uri points to the "/project/" as expected. Also, _url of _GET is "/controller" as expected
I tried to add in router.php , according router's documentation https://github.com/phalcon/cphalcon/blob/v3.4.0/phalcon/mvc/router.zep
$router = $di->getRouter();
// Define your routes here
$router->removeExtraSlashes(true);
$router->handle();
but still getting two slashes as described above. what's wrong ? Phalcon is 3.4
Thanks in advance .