• Stars
    star
    271
  • Rank 151,717 (Top 3 %)
  • Language
    PHP
  • Created about 11 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Yii 2 Framework Code Generator Gii on Steroids

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

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


Built by dmstr

More Repositories

1

docker-nginx-redirect

Docker container for redirecting web-traffic based on nginx
Shell
107
star
2

gii-template-collection

Gii Template Collection with code templates for models and CRUDs
PHP
51
star
3

docker-yii2-app-basic

Docker Container for Yii 2.0 Basic Application
Shell
40
star
4

docker-gitlab-runner

GitLab CI runner with docker-compose support (based on gitlab-ci-multi-runner)
Dockerfile
32
star
5

database-command

Yii command to create database migrations from existing schema
PHP
19
star
6

yii2-extension-requests

Ideas "marketplace" for Yii 2 extensions
18
star
7

yii2-packaii

Yii 2 Composer Package Toolkit
PHP
16
star
8

p3media

Yii media manager module
PHP
13
star
9

docker-mariadb-example-databases

Dockerfile for MariaDB Server with example databases
Shell
12
star
10

p3admin

Yii backend module
PHP
12
star
11

p3extensions

Extensions shared among Phundament 3 core modules
HTML
11
star
12

p3widgets

Yii widget management module
PHP
9
star
13

doma

Makefile templates for dockerized applications
Makefile
8
star
14

yii2-markdocs-module

Yii 2.0 Markdown Docs Module
PHP
8
star
15

yii-relation

Yii Framework active record relation components
PHP
7
star
16

multi-theme

Yii Framework Theme-Manager class, switch themes by regular expressions on controller routes.
PHP
6
star
17

giic

Toolset for running Gii on the command line
PHP
5
star
18

nano

Phundament application template
PHP
4
star
19

php-inflector

Standalone PHP 5.2 Inflector backport from Yii 2.0
PHP
4
star
20

docker-boilr

Docker image for boilr
3
star
21

repojis

Biased emoji meanings for developers
3
star
22

web-user-behavior

Yii Behavior, which implments features from WebUser from mishamx/yii-user
PHP
3
star
23

docker-toolbox

docker, docker-machine & docker-compose
Dockerfile
3
star
24

p3pages

PHP
3
star
25

yii-ckeditor-configurator

Yii Framework module to handle ckeditor templates and styles
PHP
2
star
26

lessii

2
star
27

eucliid

Euphemistic CLI for Yii 2.0 Framework (optionally built with Docker)
2
star
28

yii2-yaml-converter-command

DEPRECATED
PHP
2
star
29

foxy-roxy-rabbit

WIP - A dockerized application template for Yii 2.1 Framework
PHP
2
star
30

yii-access

Yii Framework extension for access checks on active record level
PHP
2
star
31

p3bootstrap

Bootstrap Theme for Phundament 3
CSS
2
star
32

yii2-sakila-module

Demo project for schmunk42/yii2-giiant
PHP
2
star
33

yii-backend-theme

Yii Framework Theme for Application Backend
CSS
1
star
34

yii2-templay

Template toolkit for Yii Framework 2
PHP
1
star