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
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
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.
Awesome Post. Have been waiting for a long time. Thanks for sharing.
ReplyDeleteSpoken English Classes in Velachery
Spoken English in Velachery
Spoken English Classes in Tambaram
Spoken English Class in Chrompet
Spoken English Classes in OMR Chennai
Spoken English Classes in Navalur
Spoken English Class in Ambattur
Spoken English Class in Avadi
Thanks for sharing this wonderful and fantastic content it is really an great information.
ReplyDeleteAngularJS training in chennai | AngularJS training in anna nagar | AngularJS training in omr | AngularJS training in porur | AngularJS training in tambaram | AngularJS training in velachery
The information have been given by this blog, which is very informative and truly helpful.
ReplyDeleteCyber Security Training Course in Chennai | Certification | Cyber Security Online Training Course | Ethical Hacking Training Course in Chennai | Certification | Ethical Hacking Online Training Course |
CCNA Training Course in Chennai | Certification | CCNA Online Training Course | RPA Robotic Process Automation Training Course in Chennai | Certification | RPA Training Course Chennai | SEO Training in Chennai | Certification | SEO Online Training Course
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.
ReplyDeleteBest Java Full Stack Training Institute in Hyderabad