mdmsoft / yii2-admin

Auth manager for Yii2 (RBAC Manager)
GNU General Public License v3.0
1.16k stars 577 forks source link

Installation failed #1

Closed DrMabuse23 closed 10 years ago

DrMabuse23 commented 10 years ago

PHP Fatal Error – yii\base\ErrorException

Call to a member function getItems() on a non-object

  1. in /vendor/mdm-yii2/mdm-admin/mdm/admin/models/AuthItemSearch.php at line 54 4950515253545556575859 / public function search($params) { / @var \yii\rbac\Manager $authManager */ $authManager = Yii::$app->authManager; $items = $authManager->getItems(null, $this->type); if ($this->load($params) && $this->validate()) { $items = array_filter($items, function($item) { if (trim($this->name) === '') { return true; }
  2. yii\base\Application::handleFatalError()
sangkilsoft commented 10 years ago

Your problem can resolve by setup authManager component on config. ie. for file base: 'authManager' => [ 'class' => 'yii\rbac\PhpManager', 'authFile' => '@app/runtime/rbac.php' ]

for db base 'authManager' => [ 'class' => 'yii\rbac\DbManager' ]

But, as this ext not support auto generate auth tables, you must generate auth tables yii/rbac/schema-yourdb.sql manually. I hope the auth tables auto generator be implemented next.

DrMabuse23 commented 10 years ago

thx works very well