prawee/yii2-widgets
Composer 安装命令:
composer require prawee/yii2-widgets
包简介
yii2 widgets alert
关键字:
README 文档
README
The extends class for all widgets classes on views
contains
- ButtonAjax for make ajax button for showing modal
- LinkAjax for make ajax link for showing modal
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist prawee/yii2-widgets "dev-master"
or add
"prawee/yii2-widgets": "dev-master"
to the require section of your composer.json file.
Usage
ButtonAjax | LinkAjax
on your views
use prawee\widgets\ButtonAjax; use yii\bootstrap\Modal; echo ButtonAjax::widget([ 'name'=>'Create', 'route'=>['create'], 'modalId'=>'#main-modal', 'modalContent'=>'#main-content-modal', 'options'=>[ 'class'=>'btn btn-success', 'title'=>'Button for create application', ] ]); ... Modal::begin(['id'=>'main-modal']); echo '<div id="main-content-modal"></div>'; Modal::end();
on your controller
public functionn actionCreate(){ ... if(Yii::$app->getRequest()->isAjax){ return $this->renderAjax('create', [ 'model' => $model, ]); }else{ return $this->render('create', [ 'model' => $model, ]); } }
统计信息
- 总下载量: 1.51k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-08-14