php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -


i've installed yii2-user module/dektrium yii2-app-basic application command

composer require "dektrium/yii2-user:0.9.*@dev" 

config/console.php

return [     .     .     'modules' => [         'gii' => 'yii\gii\module',         'user' => [             'class' => 'dektrium\user\module',             ],         ],     .     . ] 

config/web.php

'components' => [     .     .     /*         'user' => [             'identityclass' => 'app\models\user',             'enableautologin' => true,         ],     */     'modules' => [         'user' => [             'class' => 'dektrium\user\module',             ],     ],     .     . ] 

after that, run command $ php yii migrate/up --migrationpath=@vendor/dektrium/yii2-user/migrations updating database schema .

but, when run http://localhost/mylawsuit/yii/web/index.php?r=user/registration/register in browser. throws error:

invalid configuration – yii\base\invalidconfigexception

the configuration "modules" component must contain "class" element.

screenshot of error

enter image description here

and, when i'm changing web.php

'user' => [             'identityclass' => 'app\models\user',             'enableautologin' => true,         ],     /*     'modules' => [         'user' => [             'class' => 'dektrium\user\module',             ],     ], 

typing http://localhost/mylawsuit/yii/web/index.php?r=user/registration/register in browser, shows

not found (#404)

page not found.

screenshot

enter image description here

i'm not getting i'm doing mistake. please me rectify.

i got answer.

i wrote 'modules'=>[...] inside 'components'=>[...], wrong.

now, config/web.php

$config = [   'id' => 'basic',   'basepath' => dirname(__dir__),   'bootstrap' => ['log'],   'components' => [    .    .    .    ],   'modules' => [     'user' => [       'class' => 'dektrium\user\module',     ],   ],   'params' => $params, 

now, it's working fine.


Comments

  1. Excellent information, which I truly valued. It's easy to read and has a lot of potential, so I've bookmarked it for future reference. Thank you for sharing, pro. It appeals to me.
    Best Java Full Stack Training Institute in Hyderabad

    ReplyDelete

Post a Comment

Popular posts from this blog

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -