We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

inheritance in partials - controller for sidebar?

I plan to build a website that have 2 columns. I want to use 2 controller at a time. One for main columns and other for sidebar. How can i do this with volt?



43.9k
edited May '14

Hi, "I want to use 2 controller at a time" : this is not possible.

You will have to use volt "block" definition (such as "sidebar" and "main"). If your sidebar will be "static" (meanning, will not change from a controller to an another) than you can define its content in your ControllerBase, if it change per controller, then define its content in each controller, ...

you can also use template inheritance https://docs.phalcon.io/en/latest/reference/volt.html#template-inheritance wich is a pretty cool feature