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

What is the use of .volts inside of "invo\app\views\layouts" ?

I see an index.volt and many other .volt files inside "invo\app\views\layouts" - trying to understand why would you want to use these ? this example only has {{ content() }} in almost all .volt files.

Suppose you have a controller with name UsersController, you action volt files will go to app/views/users/.... By creating an app/views/layouts/users.volt, all actions in that controller will be wrapped by that template. Try placing some HTML in those files and you'll see ;]



5.2k

When create view files corresponding to controller/action, use of volt engine is best way for create it easily and fastest. Script in volt is very easy than php plain-text. For instance, {{ content }} equal to code "<?php echo $this->getContent(); ?>".