Is there a way to use hash mark in route pattern? I tried to use backslash before hash mark \#
, but no result.
My code:
use Phalcon\Mvc\Router\Group;
$gr = new Group([
'module' => 'home',
]);
$gr->addPost("/item/view/([0-9]*)/#([0-9]*)", [
'module' => 'item',
'controller' => 'view',
'firstId' => 1,
'secondId' => 2,
])->setName('item:view:hash');
$router->mount($gr);
Usage:
echo $this->url->get(['for' => 'item:view:hash', 'firstId' => 1, 'secondId' => 2])
gives me a correct url: /item/view/1/#2
, but I receive a warning:
Unknown modifier '('
Is there a way to remove warnings, to use the hash mark in the right way? Thanks in advance.
Nothing after the #
mark is sent to the server, so including it in a server-side route doesn't do anything. The fragment/anchor is client-side only.