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

How to include sidebar

Hi, How to include my sidebar.volt to other views? using partial but its must be want pass parameters.

ı want sidebar include with all render data?

example: its have a last post variable in database. data give controller and setvar sidebar volt. ı using partial sidebar include other volt but no have last post data its want pass parameters.



58.4k

Hi

You can use partial to do this, for example a below

                {{ partial('partials/vote', ['object' : 'posts'])}}

With variable is object



3.7k

I know this. But ı want use without pass object.Is it possible?

For example domain.com/controller/sidebarAction call have all data. but partial('controller/sidebar') dont have data only show static codes.

Hi

You can use partial to do this, for example a below

               {{ partial('partials/vote', ['object' : 'posts'])}}

With variable is object