Gii Template Collection with code templates for models and CRUDs
Clone or download
Pull request Compare This branch is 306 commits behind develop.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
_dev
components
fullCrud
fullModel
.gitignore
README.md
changelog.txt
composer.json

README.md

This is the gii template collection

Fork on github

Setup

To use it, simply extract the content of the archive into your application extensions/ directory and configure the templates in the 'generatorPaths' section of the gii Configuration inside your application configuration:

'gii'=>array(
    'class'=>'system.gii.GiiModule',
    'password'=>'<your gii password>',
    'generatorPaths'=>array(
        'path.to.gii-template-collection',   // extensions/Gii Template Collection
        ),
    ),

After that, the new Generators of the Gii Template Collection should be available in your Gii index page.

The last step is to add 'ext.gtc.components.*' to your import path so the needed components can be found by the application:

// autoloading model and component classes
'import'=>array(
	'application.models.*',
	'application.components.*',
	'application.modules.user.models.*',
	'path.to.gii-template-collection.components.*', // Relation Widget
),

Usage

Full Model

tbd

Full CRUD

Requires clevertech/yiibooster

Template slim

tbd

Template hybrid

An enhanced hybrid between the default/slim templates and the bootstrap crud generator.

Requires yii-bootstrap, x-editable-yii and echosen.

Experimental

Note: This feature is not yet available!

You also have the ability to add custom field providers by config.

'gii' => array(
    'params' => array(
        'gtc.fullCrud.providers' => array(
            'p2.gii.fullCrud.providers.P2FieldProvider',
        )
    )
)

Please enjoy this extension and give your feedback at the github Repository, thank you.

Of course, any templates are appreciated and just leave a comment or mail: schmunk@usrbin.de, fredrik@neam.se or thyseus@gmail.com.

GTC Coding Standards

GTC is using <?=""?> Bobsled Coding Style.

  • Write PHP code wrapped in short-open-echo tags and double quotes <?="<?php ...code... ?>"?>
  • Use brackets {} to insert variables for generated code

Examples

tbd

Ressources

Links

History