我在使用Laravel,PHP和Blade时遇到问题
@for ($i=1; $i <= 12; $i++)
{!!
($substance->consumptions->filter(function($consumption, $key){
return $consumption->date->month == $i;
})->sum('quantity'))
!!},
@endfor
未定义变量:i(查看:/Users/luisalcaras/Projects/piba_web/resources/views/index.blade.php)
答案 0 :(得分:3)
您必须使用conv1 = conv2d(data, filters, kernel_size=[2, 2], padding='same', activation=tf.nn.relu)
关键字将变量从父作用域传递到闭包:
'use'
希望这有帮助
答案 1 :(得分:-1)
试试这个吗?
@for ($i=1; $i <= 12; $i++)
{!!
($substance->consumptions->filter(function($consumption, $key){
global $i;
return $consumption->date->month == $i;
})->sum('quantity'))
!!},
@endfor