2017 © Pedro Peláez
 

yii2-extension hii

Gii extension - complex model generator for Yii 2 Framework

image

grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  • Thursday, February 11, 2016
  • by grzegorz-pierzakowski
  • Repository
  • 1 Watchers
  • 0 Stars
  • 36 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 16 Versions
  • 0 % Grown

The README.md

hii

Extended models for Gii, the code generator of Yii2 Framework, (*1)

What is it?

Hii provides automatic model generation for complex db models. It supports: - many relations between two models - 'name2other_name' db table names - cascade model structure:, (*2)

models
|- base / model.php  <- this one has automaticly generated relations
|- model.php
  • relation to self is possible only by setting it in 'customRelations'
  • autogenerating static methods findBy{UniqieField}

Installation

The preferred way to install this extension is through composer., (*3)

composer.phar require grzegorz-pierzakowski/hii:"*"

or you can add this into the composer.json:

"grzegorz-pierzakowski/hii": "*"

The Hii-model generator is registered automatically in the application bootstrap process, if the Gii module is enabled, (*4)

Use custom options (It's in params untill Yii2 enables passing config to generators)

$config['params']['hii-model'] = [
            // put your custom pairs of 'table' => 'ModelName' map here
            'tableModelMap' => [
            ],
            // put your pairs of 'column_name' => 'RelationSuffix' map here
            // this will allow to generate more than one relation between 2 models
            'customRelations' => [
            ]
        ]

Usage

Visit your application's Gii (eg. index.php?r=gii and choose Hii Model from the main menu screen., (*5)

For basic usage instructions see the Yii2 Guide section for Gii., (*6)

Let's assume you have a ggroup table represented by Group object and ggroup has user_id and user_last_id columns. You have two relations to User object then. If you set the project as:, (*7)

$config['params']['hii-model'] = [
    'customRelations' => [
        'last_user_id' => 'Last'
    ],
    'tableModelMap' => [
        'ggroup' => 'Group'
    ]
]

Magic will happen and your models will have relations as below:, (*8)

Group User->myGroup
Group User->myGroupLast
User Group->lastUser
User Group->user

The Versions

11/02 2016

dev-master

9999999-dev https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

11/02 2016

1.2.2

1.2.2.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

12/01 2016

1.2.0

1.2.0.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

12/01 2016

1.2.1

1.2.1.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

23/06 2015

1.1.0

1.1.0.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

23/06 2015

1.0.6

1.0.6.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

21/06 2015

1.0.5

1.0.5.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

15/06 2015

1.0.4

1.0.4.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

14/03 2015

1.0.3

1.0.3.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

13/03 2015

1.0.2

1.0.2.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

13/03 2015

1.0.1

1.0.1.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

13/03 2015

0.9

0.9.0.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

13/03 2015

1.0.0

1.0.0.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

13/03 2015

0.2

0.2.0.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

11/03 2015

0.1

0.1.0.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model

11/03 2015

0.1.1

0.1.1.0 https://github.com/grzegorz-pierzakowski/hii

Gii extension - complex model generator for Yii 2 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 gii model