schmunk42 / yii2-giiant

Yii 2 Framework Code Generator Gii on Steroids
271 stars 120 forks source link

yii2-giiant

"Giiant is huge!"

Build Status

What is this?

Giiant is an extended code-generator for models and CRUDs, based upon Gii (Yii 2.0 Framework).

It creates prototypes for database models and backends including relations defined by foreign-key constrains in no-time.

To provide a highly flexible configuration system it features a callback-provider-queue to define rendering of customized inputs, columns or attribute values.

A main project goal is porting many features and learnings from gtc, giix, awecrud and other code-generators into one solution.

Resources

Features

Batch command

Model generator

CRUD generator

Installation

The preferred way to install this extension is through composer.

Using a stable version

composer require schmunk42/yii2-giiant:"@stable"

Using latest master

composer require schmunk42/yii2-giiant:"@dev"

The generators are registered automatically in the application bootstrap process, if Gii module is enabled.

You can try giiant via phd (dockerized PHP application template).

Configuration

It's recommended to configure a customized batch command in your application CLI configuration.

'controllerMap' => [
    'batch' => [
        'class' => 'schmunk42\giiant\commands\BatchController',
        'overwrite' => true,
        'modelNamespace' => 'app\\modules\\crud\\models',
        'crudTidyOutput' => true,
    ]
],

Note: yii giiant-batch is an alias for the default configuration of BatchController registered by this extension.

You can add the giiant specific configuration config/giiant.php, and include this from your config/main.php.

See the batches section for configuration details.

Usage

To create a full-featured database backend, run the CLI batch command

yii batch

You can still override the settings from the configuration, like selecting specific tables

yii batch --tables=a,list,of,tables

Core commands

Show help for gii

yii help gii

Create application-module for giiant CRUDs

yii gii/giiant-module

The commands for generating models and CRUD, there are usually run via the batch command above.

yii gii/giiant-model
yii gii/giiant-crud

Advanced

Provider usage and configuration via dependency injection

See docs for details.

Using callbacks to provide code-snippets

See docs for details.

Troubleshooting

See docs for known-issues, platform specific usage, quirks, faq, ...

Extras

Special thanks to motin, thyseus, uldisn and rcoelho for their work, inspirations and feedback.

Screenshots

giiant-0 2-screen-1 giiant-0 2-screen-2


Built by dmstr