laravel 下函数内访问函数外变量
function something($p)
{
Mail::send('view', array(
"email" => $p->email
), function ( $message)
{
$message->to($p->email, $p->name)->subject('hello');
})
}
怎么在laravel框架下Mail::send的第三个参数闭包内访问闭包外的变量?
恶势力出现
10 years, 5 months ago
Answers
function () use ($var) {
http://php.net/manual/en/functions.anonymous.php#example-186
C.罗纳尔多
answered 10 years, 5 months ago