zelenin / yii2-widgets
This package is abandoned and no longer maintained.
No replacement package was suggested.
Yii2 widgets
0.0.3
2014-11-02 00:00 UTC
Requires
- yiisoft/yii2: ~2
This package is not auto-updated.
Last update: 2018-09-25 08:28:47 UTC
README
Yii2 widgets
Installation
Composer
The preferred way to install this extension is through Composer.
Either run
php composer.phar require zelenin/yii2-widgets "dev-master"
or add
"zelenin/yii2-widgets": "dev-master"
to the require section of your composer.json
Usage
Alert widget
Insert to create and update views:
echo Zelenin\yii\widgets\Alert::widget();
Add flashes in controller actions like:
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->getRequest()->post()) && $model->save()) {
Yii::$app->getSession()->setFlash('success', 'Updated');
return $this->redirect(['update', 'id' => $model->id]);
} else {
return $this->render('update', ['model' => $model]);
}
}
Error widget
Insert to create and update views:
echo Zelenin\yii\widgets\Error::widget(['model' => $model]);
Author
Aleksandr Zelenin, e-mail: aleksandr@zelenin.me