3

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?

Jan Drábek
  • 146
  • 6

1 Answers1

2

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'); 
Nikolay Mihaylov
  • 3,868
  • 8
  • 27
  • 32