Want to set variables in a laravel blade template? It is discouraged to do in a view so there is no blade tag for it. If you do want to do this in your blade view, you can either just open a php tag as you wrote it or register a new blade tag.
Here is an example:
1 2 3 4 5 6 7 8 9 | <?php /** * <code> * {? $old_section = "whatever" ?} * */ Blade::extend(function($value) { return preg_replace('/\{\?(.+)\?\}/', '<?php ${1} ?>', $value); }); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.