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.



37.9k

Hi

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

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

With variable is object



1.9k

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