Jan Drábek
Jan Drábek

Reputation: 146

Forward anchor withing page in Phalcon

In Phalcon I finish one of my actions with forward response with parameters and I would need adding an anchor (e.g. to end the forwarded response with #blabla.

return $this->dispatcher->forward(array(
    'controller' => 'foo',
    'action' => 'bar',
    'params' => array(123),
));

Is that possible?

Upvotes: 3

Views: 130

Answers (1)

Nikolay Mihaylov
Nikolay Mihaylov

Reputation: 3884

Dispatcher does not change the URL in your address bar. It just simulates(loads) the requested route. However it is possible to do this with redirect:

$url = $this->url->get(['for' => 'your-route-name']);
return $this->response->redirect($url . '#hash-here'); 

Upvotes: 2

Related Questions