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

Multi theme volt

Hi, im new in Phalcon and i want to know if there is any way to have multi theme volt, for example:

  • app/views/default/index.volt
  • app/views/christmas/index.volt
  • app/views/halloween/index.volt


33.8k

https://docs.phalcon.io/en/latest/reference/volt.html#template-inheritance

  1. Create Volt inside the view service (I think you'll have that done).
  2. Create a .VOLT file that will act like a father layout (think on in as an HTML file when writting your code).
  3. Create a .PHTML file. This will be the action view. Extend ({% extends %}) from the file before, and write your code in the correct {% block %}. Note that you can do more template inheritance if you create more templates in a hierarchical way.