Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Who can tell me about This INVO {{ content() }} .

edited Jun '15


Phalcon is rendering each part based on rendering levels. So we use {{ content() }} to let the framework know where to render the next level.

Main rendering levels:

  • MainView (is the base theme which includes the layouts). Put here all code that will be common to all your layouts

  • Layouts (make as many as you need. One is enough if the page style doesn't change). Put here all the code that will be common to all views

  • Views (one view per action)

Your diagram is 100% correct

edited Jun '15

I can understand those two index.volt , now.

But why rendering the main.volt ? Just by that .

public function initialize() { $this->tag->setTitle('Welcome'); parent::initialize(); It's seems like because this . }

Why not common.volt OR Other it? : )

main.volt is set as default in framework internals, but it can be changed in anything you like with $view->setLayout($layoutNameWithoutExtension)