Just starting to move an existing php project over to phalcon 1.2.6 and having some difficulty with volt templates. In the original project, layout choices are determined dynamically in the controller depending on login status and if logged in, the type of user (There are 2 types).
Examples of layout names being used are "one-column", "two-column" and "three-column" They are mostly the same. The difference is that each template has a content section that contains 1, 2 or 3 volt blocks to match the name.
If I declare extends at the top of my views like this {% extends "../layouts/two-column.phtml" %} That works fine.The blocks are recognised and everything is rendered as expected.
However I would like to determine the layout used from the controller. So in my controllers I've tried using $this->view->setMainView('two-column'); But doing that has no affect.
I think I must find a way to alter the extends "filename" value, but have been unable to do that by passing a string to the view and using it in the extends declaration.
If I leave the extends declaration out, then the blocks are not recognized.
Does anybody know of a way to handle a situation like this? Any ideas appreciated.