samedi 22 août 2015

How to pass arguments in a custom blade directive?

In Laravel 5.1, I am trying to create a very basic blade directive:

Blade::directive('hello', function ($planet) {
    return 'Hello ' . $planet;
});

When I write:

@hello('world')

It returns:

Hello ('world')

I want:

Hello world

Yes I can remove these brackets manually but is it a bug in Laravel or what? How can I get world instead of (world) as the value of $planet.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1JnsCqd
via IFTTT

Aucun commentaire:

Enregistrer un commentaire