Home » Php » php – How to pass some variable to a Laravel Blade Templates, but not render it, is it possible

php – How to pass some variable to a Laravel Blade Templates, but not render it, is it possible

Posted by: admin February 25, 2020 Leave a comment

Questions:

First, suppose I have a simple Blade Template (store in a file.blade.php):

{{$a}}...{{$b}}...{{$c}}...{{$d}}...{{$e}}

i want to pass some value ex: $a=0 $d=9, I want the result as a string as follows:

0...{{$b}}...{{$c}}...9...{{$e}}

i will write this result to a other_file.blade.php so i can render it again with other variable.

So is there any ways to do this?

How to&Answers: