humanityANDpeace
humanityANDpeace

Reputation: 4627

How can I route to a child route in Zend 3?

I use Zend Framework Version 3. I would like to redirect the request to a new route, and in more precisely to a childroute?

If it was only a "parent" route I would to this

return $this->redirect()->toRoute('name-of-route', []);

however I have a childroute I would like to redirect to. How can this be done

Upvotes: 0

Views: 131

Answers (1)

Tim Fountain
Tim Fountain

Reputation: 33148

Assuming this works the same as in ZF2, you use a / to denote the heirarchy:

return $this->redirect()->toRoute('name-of-route/name-of-child-route', []);

Upvotes: 4

Related Questions