Skip to content

Passing props to blocks #2359

Closed Answered by Bunksly
Bunksly asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

I solved my own problem:

you can pass extra data to renderBlocks but its the 2nd parameter:

<!doctype html>
<html class="no-js" lang="en">

<head>

	<meta charset="utf-8">
	<title>Duo Behavioural Report</title>
    @vite('resources/css/app.css')
</head>

<body>
    {!! $item->renderBlocks([],['name'=> $name]) !!}
</body>

</html>

then in the block template you can echo $name

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Bunksly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant