讨论数量:
请使用注入
比如一个类
namespace App\User;
Class User {
pubic function hello()
{
return "hello world";
}
}
在 blade
模板里面
@inject('user', 'App\User')
{{ $user->hello() }} //结果hello world
请使用注入
比如一个类
namespace App\User;
Class User {
pubic function hello()
{
return "hello world";
}
}
在 blade
模板里面
@inject('user', 'App\User')
{{ $user->hello() }} //结果hello world
推荐文章: