Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a fragment id to a Zend redirect

Maybe I'm goofy and can't find the documentation. I want to add a fragment id to the end of the URL used in a controller action redirection. This is kind of what I want to do:

return $this->redirect()->toRoute('jobapplication',array('action'=>'edit','id'=>$candidateclass->application_id,'fragment'=>'candidateclass'));

All I get is this:

http://localhost/Zend/public/jobapplication/edit/21

And I want this:

http://localhost/Zend/public/jobapplication/edit/21#candidateclass

Thoughts?

like image 972
Curtis Kelsey Avatar asked Jul 22 '13 15:07

Curtis Kelsey


1 Answers

You pass the fragment in the $options array, which is the third parameter of the toRoute() method, try...

return $this->redirect()->toRoute(
    'jobapplication', 
    array('action' => 'edit', 'id' => $candidateclass->application_id), 
    array('fragment' => 'candidateclass')
);
like image 188
Crisp Avatar answered Nov 10 '22 21:11

Crisp