yii2再一次笔记
如果模块名称或者控制器名称或者动作名称用的是驼峰命名法,那么路由url里面的每个大写都要用“-”来连接如:
DateTimeController::actionFastForward 相应的路由为 date-time/fast-forward。
ArrayHelper::map($models, ‘id’, ‘name’);这个就等于array_column
$arr = array_column($a, 'name', 'id');// 组成id为键名,name为键值的二维
ArrayHelper::map($models, 'id', 'name');// 这个也是,只不过顺序不同了
$resume = (array)$resume;// 对象转数组(string)
$applyer->attributes['id'];// 获取到最新插入的id
// 如何利用yii的load没有post自己保存数据+
$Applyer = new Applyer();
$Applyer['hr_id'] = $applyerData['hr_id'];
$Applyer['status'] = self::STATUS_WAIT_CHAT;
// $Applyer->validate();
$Applyer->load($Applyer);
$Applyer->save();//当里面加false,就需要添加validate了

浙公网安备 33010602011771号