Send data to default.twig in the default theme?

mohammed_abdallah - 5 months ago

i want to send array to the default page to the theme where the controller that's i can compact my data ??? plz help

dali - 5 months ago

that's more like a laravel question but you can try:

view()->share('variable', 'value');

somewhere in you code, and then use it in twig file: {{ variable }}

mohammed_abdallah - 5 months ago

i know this way but where i put this line ??

mohammed_abdallah - 5 months ago

u got me ? i can't find the controller that's render the default view ?

ryanthompson - 5 months ago

Can you use variables or something to control this? Otherwise you can make a plugin class inside your theme and add some constants or functions to help you out there.

https://pyrocms.com/help/addon-development/plugins

You can also add a FooThemePlugin class next to your FooTheme class and it'll be picked up automatically.