Render a Controller -> action -> view from .volt or .html


I have a view which prints the latest posts of my blog, controller -> action latestPostsAction(); this action takes from database te listo of the recent 10 posts. and uses its view.

the problem is that I want to render this view but with FULL process in diferent layouts, this means I have my index which shows in tle right this controller of a list of recent posts, but i want it also on the layout where the user read the posts.

In symfony they have:

<!-- app/Resources/views/base.html.php -->

<!-- ... --> <div id="sidebar"> <?php echo $view['actions']->render( new \Symfony\Component\HttpKernel\Controller\ControllerReference( 'AcmeArticleBundle:Article:recentArticles', array('max' => 3) ) ) ?> </div>

which does what I want, every time this module is called it asks for the list to the database . how do I do same behaviour on Phalcon?

Hi, try to read this part of documentation

And one notice: Its possible render .volt into string variable. Read this


Hi Peter, thanks for your response,

I already read that documentation and cant find what I need, the most similar thing is the partials and the getRender you mention,

but none of them go through the controller to render the view.

a clear example of what I need is

I have a controller with:

public function hiAction() { $this->view->setVar("name", "oplaza");


and its view


hi {{name}}, how are you

This can be done with a partial , sending the name as a parameter,

but what I want is to call to its controller which already have the param set.