It sounds like you're just jumping in to Phalcon and MVC from a more classic style of setting up sites. Take your time and really leverage the documentation.
I think if you hit the docs, and prepare to shift your mindset on how to assemble sites, you should pick up the "Phalcon way" pretty quickly.
Check out: https://docs.phalcon.io/en/latest/reference/views.html
You can set up your main "outer" template in app/views/index.volt
, and then the individual page "inner" templates go into files like app/views/index/index.volt
and app/views/about/index.volt
and so on. Any data preparation or logic will go into the controller files in app/controllers/IndexController.php
and app/controllers/AboutController.php
and so on. The routing will take care of putting it all together.
- app/
- controllers/
- IndexController.php // logic for index page
- AboutController.php // logic for about page
- views/
- index.volt // "outer" template with header, footer, and css.js includes (all pages load this)
- index/
- index.volt // "inner" template for index page
- about/
- index.volt // "inner" template for about page
Hope this helps!