2017 © Pedro Peláez
 

yii2-extension yii2-widgets

yii2 widgets alert

image

prawee/yii2-widgets

yii2 widgets alert

  • Wednesday, February 8, 2017
  • by prawee
  • Repository
  • 1 Watchers
  • 2 Stars
  • 884 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 1 Versions
  • 11 % Grown

The README.md

Extends widgets classes for Yii2 and Bootstrap 4

The extends class for all widgets classes on views, (*1)

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., (*2)

Either run, (*3)

php composer.phar require --prefer-dist prawee/yii2-widgets "dev-master"

or add, (*4)

"prawee/yii2-widgets": "dev-master"

to the require section of your composer.json file., (*5)

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 '

'; 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,
        ]);
    }
}

The Versions

08/02 2017

dev-master

9999999-dev

yii2 widgets alert

  Sources   Download

MIT

The Requires

 

extension yii2 alert