Laravel Blade Helper


When creating new custom Blade directives using the Blade :: directive (...) method, the only parameter that can be used to render is the expression passed as a raw string from the .blade.php file. It is rare for developers to parse the contents of an expression within the directive, preferring instead to pass the entire expression as an argument function or as a method in another class.

for example:

BladeHelper::directive('uppercase', function($expression) { return "<?php echo strtoupper($expression); ?>";});

Since this appears to be the most common use case, this package tries to help make these auxiliary functions a little easier to identify, without rotating the rope or having to think about what an expression might be when creating an instruction.

Read me There are plenty of useful examples such as the directive and describing the function of searches. In this example, the instruction strtouppercalls the built-in function:



KARABAY A, 2019 . Laravel Blade Helper,

(Accessed June 24, 2019).

  Share this post

Comments (0)


Sign up for the email newsletter to be the first to know about my blog posts