I install it through Composer, I set the settings in frontend / config / main.php , but nothing is shown at /index.php?r=gii, that is, the standard page is shown. What have I done wrong?

frontend / config / main.php

'bootstrap' => ['gii'], 'modules' => [ 'gii' => 'yii\gii\Module', // ... ], 
  • прописал настройки в frontend/config/main.php ...... what? add the config to the question ....... and is there a main-local config with common ? - Alexey Shimansky
  • Added config to the question. in the common folder there is a config main-local - Diefair
  • This is some kind of mahaaaalen config. you lay it all out. And in common/main-local there are lines 'urlManager' => [ 'enablePrettyUrl' => true, ], ,? ..... and in frontend and backend there is a main-local? ibid already should be registered there - Aleksey Shimansky
  • in common/main-local there is no such thing, such is in frontend/config/main . and yes, frontend/config/main-local gii is already registered - Diefair
  • This is probably the problem. This allows you to write beautiful urlah. Those. you can write mysite.ru/gii .... true with the option 'request'=>[ 'baseUrl'=>'', ], ...... And if you set 'enablePrettyUrl' => false, then you can write index.php?r=gii and once gii is connected to main-local, then in main you write 'modules' => [ 'gii' => 'yii\gii\Module', // ... ], it’s not necessary - Alexey Shimansky

1 answer 1

  1. frontend / config / main.php

    'urlManager' => ['enablePrettyUrl' => true, 'showScriptName' => false,],

2 frontend / config / main-local.php

 if (!YII_ENV_TEST) { // configuration adjustments for 'dev' environment $config['bootstrap'][] = 'debug'; $config['modules']['debug'] = [ 'class' => 'yii\debug\Module', 'allowedIPs' => ['*'], ]; $config['bootstrap'][] = 'gii'; $config['modules']['gii'] = [ 'class' => 'yii\gii\Module', 'allowedIPs' => ['*'], ]; } 

now you can go to site.com/gii (if you have baseUrl => '' for the front)