syntax error, unexpected '$res' (T_VARIABLE)
为什么会错??
public static function getAllCats()
{
$cat = ['0'=>'No cats'];
$res = self::find()->asArray()->all();
if($res)
{
foreach($res as $k=>$list)
$cat[$list['id']]=$list['cat_name'];
}
return $cat;
}
为什么会错??
public static function getAllCats()
{
$cat = ['0'=>'No cats'];
$res = self::find()->asArray()->all();
if($res)
{
foreach($res as $k=>$list)
$cat[$list['id']]=$list['cat_name'];
}
return $cat;
}
2017-05-13
举报