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

view action helper

Hi everyone,

I'm looking for some solution on how to render an action into another action? For example in Zend Framework in each action I can call <?= $this->action('action', 'controller','module') ?>

In volt I can only render another volt view file: {{ partial('path_to_view/file') }}

when I have some logical code into this view or I send some vars - this command doesn't call the controller.

Any ideas?



12.8k

volt doesn't have method component

Undefined function 'component'



33.8k

Maybe an alternative solution will be creating a Component with a function that returns a string of the part of the action's view that you want to render (I do that to present my project's navBar of Bootstrap in multiple controllers actions).

But I think it won't be useful for you (unless that action's view has little things you want to partial render).