【发布时间】:2015-11-16 08:28:42
【问题描述】:
在 Laravel 5.1 中,我正在尝试创建一个非常基本的刀片指令:
Blade::directive('hello', function ($planet) {
return 'Hello ' . $planet;
});
当我写的时候:
@hello('world')
返回:
Hello ('world')
我想要:
Hello world
是的,我可以手动删除这些括号,但这是 Laravel 中的错误还是什么?我怎样才能得到world 而不是(world) 作为$planet 的值。
【问题讨论】:
标签: php laravel laravel-5 blade laravel-5.1