rmrevin / yii2-comments

Yii 2 comments extension
MIT License
52 stars 19 forks source link

Problems with modelMap config property #21

Closed akmaks closed 6 years ago

akmaks commented 6 years ago

Hi! I configured some events with basic Comment model. When I was trying to edit existing comment I have got Error "Class name must be a valid object or a string". For example, with this code "edit comment" don't working:

'comments' => [ 'class' => 'rmrevin\yii\module\Comments\Module', 'userIdentityClass' => 'frontend\models\User', 'useRbac' => false, 'modelMap' => [ 'Comment' => [ 'class' => 'rmrevin\yii\module\Comments\models\Comment', 'on ' . yii\db\ActiveRecord::EVENT_INIT => function($event) { print_r($event->sender); }, ], ], ],