Answer the question
In order to leave comments, you need to log in
How to pass the value of a variable to your Blade directive?
Another question about the Blade templating engine. Again, as in the previous example, I display the date formatted using Carbon:
Blade::directive('date', function($expression) {
return '<?php echo Carbon::ФУНКЦИЯ(' . $expression . '); ?>'
});
@date($date)
Answer the question
In order to leave comments, you need to log in
So far I've solved the problem with the following code:
Blade::directive('date', function($expression) {
return '<?php echo Carbon\Carbon::ФУНКЦИЯ(' . $expression . '); ?>'
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question