Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 397
Jan Drábek Avatar asked Dec 16 '25 16:12

Jan Drábek


1 Answers

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'); 
like image 64
Nikolay Mihaylov Avatar answered Dec 19 '25 07:12

Nikolay Mihaylov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!