ofilin/yii2-fillmodel
Composer 安装命令:
composer require ofilin/yii2-fillmodel
包简介
Fill model from last saved model use Session
关键字:
README 文档
README
Automatic fill new model attributes with last saved model.
Last attributes stored in session
Installation
Add the package to your composer.json:
{
"require": {
"ofilin/yii2-fillmodel": "^0.1"
}
}
and run composer update or alternatively run composer require ofilin/yii2-fillmodel:^0.1
Usage
In action create, add Fill::model($model, ['attribute_1', 'attribute_2', 'attribute_3']);
public function actionCreate()
{
$model = new Posts();
// Add this line:
\ofilin\fillmodel\Fill::model($model, ['groups', 'scheduled_date', 'scheduled_time']);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['index']);
}
return $this->render('create', [
'model' => $model,
]);
}
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-15