Yii 2.0: yii2-auto-crud

Automaticall creates Models and CRUD from database tables.
8 followers

Yii2 Auto CRUD

Updated July 20, 2014

Overview

This extension queries all tables in a connection database (usually db) and creates all models, controllers and views (CRUD) automatically.

Create the database tables first then run this extension and it will create the majority for you.

Demo: http://demo.c006.us/crud

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist "c006/yii2-auto-crud" "*"

or add

"c006/yii2-auto-crud": "*"

to the require section of your composer.json file.

Required

Basic

config/web.php

Advanced

[backend|frontend|common]/config/main.php

Add to config

        'modules'    => [
            'crud' => [
                'class' => 'c006\crud\Module',
            ],
            ...
            ...
        ],

Install before using "yii2-auto-crud".

php composer.phar require --prefer-dist "c006/yii2-submit-spinner" "*"

Options

No options for this extension

Usage

Pretty Url's /crud

No pretty Url's index.php?r=crud

Errors

If you see this error.

Error Message

In this file vendor/c006/yii2-auto-crud/assets/AppAssets.php

comment out these lines.

        public $depends = [
            // 'yii\web\YiiAsset',
            // 'yii\widgets\ActiveFormAsset',
            // 'yii\bootstrap\BootstrapAsset',
        ];

Comments / Suggestions

Please provide any helpful feedback or requests.

Thanks.

Total 3 comments

#17923 report it
newbie74 at 2014/08/11 03:27pm
Good job!

Good job! A real life saver with the new "full name" need!

It created everything until it reached my views. Apparently it cannot identify that the "table" (it is a view actually) does not have a pk and then it crashes.

Suggestion - since there is no sense creating crud for views, create the model and skip the rest.

#17762 report it
jchambers at 2014/07/20 11:13pm
@ThePr0f3550r

I appreciate the update, thank you.

It has been fixed.

#17759 report it
ThePr0f3550r at 2014/07/20 07:19pm
Good Job

Good job.. I can't Your demo..

Leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet