How to call a controller function inside a view in laravel 5

前端 未结 10 994
感情败类
感情败类 2020-11-29 05:23

In laravel 4 i just used a function

$varbl = App::make(\"ControllerName\")->FunctionName($params);

to call a controller function from a

10条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 05:57

    Actually below should work as per Laravel 5:
    Usage: App::make(ControllerName)->functionName($parameters);
    Example: App:make("TestController")->getUserInfo('user_id' => 9);

    Please post the actual error you are getting!

提交回复
热议问题