schmunk42/yii2-giiant Gii CRUD generator for Yii 2 Framework

giicrud

yii2-giiant

"Giiant is huge!"

PROJECT IS IN BETA STAGE!

Note: Major changes from 0.4 to 0.5, see upgrading for details.

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

  • yii batch creates all models and/or CRUDs for a set of tables sequentially with a single command

Model generator

  • generates separate model classes to customize and base models classes which can be regenerated on schema changes
  • table prefixes can be stipped off model class names (not bound to db connection settings from Yii 2.0)

CRUD generator

  • input, attribute, column and relation customization with provider queues
  • callback provider to inject any kind of code for inputs, attributes and columns via dependency injection
  • virtual-relation support (non-foreign key relations)
  • model, view and controller locations can be customized to use subfolders
  • horizontal and vertical form layout
  • options for tidying generated code
  • action button class customization (Select "App Class" option on the Action Button Class option on CRUD generator to customize)

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-1giiant-0 2-screen-2


Built by dmstr

Changelog

Changelog

0.9.1

  • improved detection of database text columns in callbacks

0.9.0

beta3-beta6

  • added color column example
  • apply cutom model name in UI giiant
  • added icons, relation buttons
  • wrap action column buttons in div
  • enable tidyOuput in batch controller by default
  • generate Access Filter Migrations #179
  • do not overwrite search model class by default; added parameter
  • splitted providers into core and extension providers, getCoreProviders should return core providers only
  • removed hardcoded layout from grid, use DI to configure grid
  • added static callback functions for field and column
  • removed logic from model-extended template, see also #170
  • added kartik gridview to modules in test config
  • updated tests

0.9.0-beta2

  • added catalogue for model related translations to CRUD generator

0.9.0-beta1

  • fixed missing spaces in headlines
  • fixed #141 - removed dependency to dmstr\helpers\Html
  • fixed crud/default/view template, create new related record link param
  • fixed #162
  • added empty merge-with-parent methods for model
  • added separate message categories for model and cruds (batch controller)
  • added route param to permission check - see also https://github.com/dmstr/yii2-web/blob/master/src/User.php
  • added parameter to enable access filter migrations
  • added parameter for controller base traits

0.8.4

  • fixed crud/default/view template, create new related record link param

0.8.3

  • fixed $actionColumnTemplateString in crud default view index.php

0.8.2

  • fixes for message catalogue / translatables
  • SavedForms fix

0.8.1

  • added mission option $useTimestampBehavior, default is true to control the use of yii\behaviors\Timestampbehavior in CLI BatchController for model generation

0.8.0

  • added giiant-extension generator
  • :warning: removed getAliasModel()
  • updated module template
  • fixed form/cli validations

0.7.2

  • fixed copy button

0.7.0-0.7.1

see git log

0.6.1 (2015-12-28)

  • improved test stack isolation
  • fixed and improved tests in CI
  • added access control to REST controller

0.6.0 (2015-12-26)

  • added separate style for default controller (giiant module index view)
  • added upgrading info
  • updated requirements
  • updated dockerized potemkin testing
  • added build message, fixed ENV handling
  • fixed php image version in testing stack
  • Merge pull request #128 from sebathi/master
  • fixed #118
  • added gitlab-ci config
  • Merge pull request #126 from pawelryznar/patch-1
  • create search model directory in batch command
  • fixed model namespace errors; added test generator to module bootstrapping
  • added cmrcx/phptidy dependency
  • removed panel class from views to allow better customization
  • fixed error, when extended controller class contained contents of the base controller
  • fixed #123
  • Merge pull request #119 from gradosevic/master
  • Merge pull request #124 from christophmuth94/master
  • fixed crudProviders paths
  • updated provider example
  • updated installation instructions
  • Added unit tests for GiiantFaker class
  • Implemented crud unit test generator. fixed issue on search model
  • added copy button for records
  • fixed flash messages - use add instead of set (do not overwrite)
  • added phptidy output option
  • fixed detection for database from DI-container
  • flush logs after every loop in batch
  • Merge pull request #117 from christophmuth94/master
  • Editor Provider updated
  • don't skip virtualAttributes by default, added property to change behavior
  • removed legacy code
  • added overwrite check for api controller
  • updated docs
  • added controller namespace property
  • refactored CRUD controllers - split into Controller and BaseController - added REST-ActiveController
  • updated tag for crud navigation buttons - using div, since <ul,ol>s are not allowed inside

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



0.9.2 is the latest of 29 releases



BSD-3-Clause license
Stats
199 github stars & 96 github forks
1 downloads in the last day
1556 downloads in the last 30 days
64601 total downloads