Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prawee/yii2-widgets
Extends widgets classes for Yii2 and Bootstrap 4
https://github.com/prawee/yii2-widgets
ajax button button-widget create modal update yii2-widgets
Last synced: about 11 hours ago
JSON representation
Extends widgets classes for Yii2 and Bootstrap 4
- Host: GitHub
- URL: https://github.com/prawee/yii2-widgets
- Owner: prawee
- Created: 2014-08-14T06:56:30.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-01-23T07:37:35.000Z (almost 4 years ago)
- Last Synced: 2024-11-03T01:20:33.616Z (12 days ago)
- Topics: ajax, button, button-widget, create, modal, update, yii2-widgets
- Language: PHP
- Homepage: http://www.prawee.com
- Size: 63.5 KB
- Stars: 2
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Extends widgets classes for Yii2 and Bootstrap 4
============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 modalInstallation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
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
```bash
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 '
Modal::end();
```#### on your controller
```bash
public functionn actionCreate(){
...
if(Yii::$app->getRequest()->isAjax){
return $this->renderAjax('create', [
'model' => $model,
]);
}else{
return $this->render('create', [
'model' => $model,
]);
}
}```