Passing variables to blocks #982
-
Is there a way to pass variables to blocks? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @marlonbasten, I think you may be looking for the $data argument of renderBlocks(). You can use it to pass extra data to your blocks, like so :
Also, you may be interested in Laravel's View::share(), that would allow you to make certain variables globally accessible to all your Blade views (including custom blocks). Hope this can help! |
Beta Was this translation helpful? Give feedback.
Hey @marlonbasten,
I think you may be looking for the $data argument of renderBlocks().
You can use it to pass extra data to your blocks, like so :
Also, you may be interested in Laravel's View::share(), that would allow you to make certain variables globally accessible to all your Blade views (including custom blocks).
Hope this can help!