Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
610 views
in Technique[技术] by (71.8m points)

php - getting Gii to work on Yii 2.0

i downloaded the advanced template, extracted it and changed the root documents for the back-end and the front-end, but i can't seem to figure out how to get Gii working to perform the crud operations.

there is require and require-dev field in the composer.JSON i included gii in both of them and each one separately with no luck.

i also tried getting the template through composer, and while installing i saw gii as installed, but still could not get it to work.

this is where i got my Yii template: https://github.com/yiisoft/yii2-app-advanced

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is how to get Gii working from a remote server for an advanced setup template.

In the frontend config file. For example:

/frontend/config/main-local.php

Add the following code:

if (!YII_ENV_TEST) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = 'yiidebugModule';

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii']=[
      'class' =>  'yiigiiModule',
      'allowedIPs' => ['*'],
    ];
}

The interesting part is the Gii array which has been modified.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...