trandangtri / yii2-giiall by trandangtri

Using Yii2-Gii to generate code for other PHP framework, such as PhalconEye, Laravel, etc.
26
2
2
Package Data
Maintainer Username: trandangtri
Maintainer Contact: trandangtri@gmail.com (Tran Dang Tri)
Package Create Date: 2014-06-13
Package Last Update: 2014-06-19
Language: PHP
License: BSD-3-Clause
Last Refreshed: 2024-03-23 15:05:35
Package Statistics
Total Downloads: 26
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 2
Total Watchers: 2
Total Forks: 1
Total Open Issues: 0

Yii2 - Gii All

Goals

Using Yii2-Gii to generate code for other PHP framework, such as Phalcon, PhalconEye, Laravel, etc.

PROJECT IS IN DEVELOPMENT STAGE!

Installation

Create a basic yii application.

php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic /path/to/yii-application

Go to the project directory and install yii2-giiall

cd yii-application
php composer.phar require trandangtri/`yii2-giiall` @dev-master

Edit the application config...

edit config/web.php

... and add the yii2-giiall generator in the YII_ENV_DEV section

$config['modules']['gii'] = array();
$config['modules']['gii']['class'] = 'yii\gii\Module';
$config['modules']['gii'] = [
    'class'      => 'yii\gii\Module',
    'allowedIPs' => ['::1', '192.168.1.*'],
    'generators' => [
        // ...
        'phalconeye-model' => [
            'class' => 'trandangtri\giiall\phalconeye\model\Generator',
            'appPath' => '../../app/'
        ],
        // ...
    ],
];

Remember setup the appPath to point to the application folder of your Core application. In this case, it pointed to PhalconEye application folder

And don't forget to setup a database application component, eg.

'db' => [
     'class' => 'yii\db\Connection',
     'dsn' => 'mysql:host=localhost;dbname=devdb',
     'username' => 'root',
     'password' => 'root',
     'charset' => 'utf8',
],

Open Gii...

http://localhost/index.php?r=gii

...and select the yii2-giiall template, you may need to create some models in advance.

References