Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

how do you render 2nd level views i.e. signup/elephants, signup/lions

SignupController and a signup folder with an index.volt is no problem

  • How do you render signup/elephants --> indev.volt
  • How do you name the controller for signup/elephants - ElephantsController? and where should it reside in controllers folders.


2.8k
Accepted
answer

Here 's how i solved this,

  • in ControllerBase added a new method that uses dispatcher and does a $this->dispatcher->forward

protected function forward($uri) { $uriParts = explode('/', $uri); $params = array_slice($uriParts, 2); return $this->dispatcher->forward( array( 'controller' => $uriParts[0], 'action' => $uriParts[1], 'params' => $params ) ); }

  • In signup controller -> added a elephantsAction

public function elephantsAction() { $this->forward("elephants/index"); }

  • in view folder created a new folder "elephants" with index.volt