When creating a complex application, you constantly face questions such as: how to design the application view structure?, and how to create layouts and where to place them?. More often than not, you end up with large parts of templates that are just copied from file to file with minimal changes. In accordance with DRY methodology, we will try to define our views in such a manner that they use the hierarchical template system. Thereby reducing the number of places where the view code can be repeated. In this recipe, we will show you how to create templates that inherit from other templates, and then we will see what you will gain from that.
For successful implementation of this recipe, you need to have an application with a configured Volt Template Engine service. In our example, we will use a template application generated by means of the Phalcon Developer Tools, however, you can use any other application that you have set.