Send data to default.twig in the default theme?
Created 7 years ago by mohammed_abdallah

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  —  7 years 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  —  7 years ago

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

mohammed_abdallah  —  7 years ago

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

ryanthompson  —  7 years 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.

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