Giter Site home page Giter Site logo

gii's Introduction

Gii.

php-version yii2-version PHPUnit Codecov

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --dev --prefer-dist yii2-extensions/gii

or add

"yii2-extensions/gii": "dev-main"

to the require-dev section of your composer.json file.

Usage

Once the extension is installed, simply modify your application configuration as follows:

return [
    'bootstrap' => ['gii'],
    'modules' => [
        'gii' => [
            'class' => 'yii\gii\Module',
        ],
        // ...
    ],
    // ...
];

You can then access Gii through the following URL:

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

or if you have enabled pretty URLs, you may use the following URL:

http://localhost/path/to/index.php/gii

Using the same configuration for your console application, you will also be able to access Gii via command line as follows,

# change path to your application's base path
cd path/to/AppBasePath

# show help information about Gii
yii help gii

# show help information about the model generator in Gii
yii help gii/model

# generate City model from city table
yii gii/model --tableName=city --modelClass=City

Configure with yiisoft/config

Add the following code to your config/config-plugin file in your application.

'config-plugin' => [
    'web' => [
        '$yii2-gii', // add this line
        'web/*.php'
    ],
],

For activate the gii generator, add in your config/params.php file in your application.

return [
    'yii2.gii' => true,
];

For change allowed IPs, add in your config/params.php file in your application.

return [
    'yii2.gii.allowedIPs' => ['192.168.1.1'],
];

For class map module, add in your config/params.php file in your application.

use App\YourClass;

return [
    'yii2.gii.classMap' => [
        'class' => YourClass::class,
    ],
];

Testing

Check the documentation testing to learn about testing.

Quality code

static-analysis phpstan-level StyleCI

Support versions Yii2

Yii20 Yii22

Our social networks

Twitter

License

The MIT License. Please see License File for more information.

gii's People

Contributors

terabytesoftw avatar stylecibot avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.