Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel trim string blade

#at AppServiceProvider

Blade::directive('trim', function ($string) {
            $string = urldecode($string);
            $string = trim($string);
            return "<?php echo $string; ?>";
        });

#And use on Blade template

@trim('Hello world !')
 
PREVIOUS NEXT
Tagged: #laravel #trim #string #blade
ADD COMMENT
Topic
Name
7+2 =