Giter Site home page Giter Site logo

biladina / yii2-ajaxcrud-bs4 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hoaaah/yii2-ajaxcrud-bs4

1.0 1.0 1.0 64 KB

Yii2 Ajax CRUD with Boostrap 4. Previously https://github.com/johnitvn/yii2-ajaxcrud

PHP 74.09% JavaScript 25.62% CSS 0.28%
yii2 boostrap4 ajax crud gii crud-generator

yii2-ajaxcrud-bs4's Introduction

yii2-ajaxcrud

Original work by johitvn.

But we need to work with Bootstrap 4, so we create this repository. If johitvn update his repo, we will delete this repository.

Latest Stable Version License Total Downloads

Gii CRUD template for Single Page Ajax Administration for yii2

index

create

view

update

delete

Features

  • Create, read, update, delete in onpage with Ajax
  • Bulk delete suport
  • Pjax widget suport
  • Export function(pdf,html,text,csv,excel,json)
  • Support Boostrap 4
  • Added translations, available right now only English and Indonesia
  • Reload multiple Pjax

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist biladina/yii2-ajaxcrud-bs4 "~2.0"

or add

"biladina/yii2-ajaxcrud-bs4": "~2.0"

to the require section of your composer.json file.

Usage

For first you must enable Gii module Read more about Gii code generation tool

Because this extension used kartik-v/yii2-grid extensions so we must config gridview module before

Let 's add into modules config in your main config file

'modules' => [
    'gridview' =>  [
        'class' => '\kartik\grid\Module'
    ]       
]

You can then access Gii through the following URL:

http://localhost/path/to/index.php?r=gii

and you can see Ajax CRUD Generator

Translate

Default translation is english, you can pull request new translation and you can change via config. Open your config main.php, add new translation to components..

Available Translation :

  • English
  • Indonesia
'language' => 'id-ID',

'components' => [
    'i18n' => [
        'translations' => [
            'yii2-ajaxcrud' => [
                'class' => 'yii\i18n\PhpMessageSource',
                'basePath' => '@yii2ajaxcrud/ajaxcrud/messages',
                'sourceLanguage' => 'id',
            ],
        ]
    ]
]

Reload Multiple Pjax

If you need to reload multiple GridView Pjax via Ajax respond from controller, you can add another Pjax ID separated by comma.

return [
    'forceReload'=>'#crud-pjax1,#crud-pjax2', // you can add more Pjax ID that you want to reload via ajax respond.
    'title'=> Yii::t('yii2-ajaxcrud', 'Create New')." Content",
    'content'=>'<span class="text-success">'.Yii::t('yii2-ajaxcrud', 'Create').' Content '.Yii::t('yii2-ajaxcrud', 'Success').'</span>',
    'footer'=> Html::button(Yii::t('yii2-ajaxcrud', 'Close'), ['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
        Html::a(Yii::t('yii2-ajaxcrud', 'Create More'), ['create'],['class'=>'btn btn-primary','role'=>'modal-remote'])
];

yii2-ajaxcrud-bs4's People

Contributors

arollmann avatar biladina avatar dshiryaev-plesk avatar hoaaah avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

bahrianpro

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.