Pass multiple parameters to a blade directive

前端 未结 9 1750
时光说笑
时光说笑 2021-02-19 07:31

I\'m trying to create a blade directive to highlight some words that will return from my search query.

This is my blade directive:

class AppServiceProvid         


        
9条回答
  •  醉话见心
    2021-02-19 08:01

    Blade::directive('custom', function ($expression) {
        eval("\$params = [$expression];");
        list($param1, $param2, $param3) = $params;
    
        // Great coding stuff here
    });
    

    and in blade template:

    @custom('param1', 'param2', 'param3')
    

提交回复
热议问题