Declaration of bedezign\yii2\audit\components\panels\DataStoragePanelTrait::getUrl() using yii2-audit

孤者浪人 提交于 2019-12-23 04:54:19

问题


I am using yii2-audit extension for audit logs, I followed all steps of installation and also migrate all tables. But when I update table value then it will return error like Audit module cannot be loaded.

I have place behaviors() in my model.

My Model

<?php
namespace frontend\models;
use yii\base\Model;
use yii\web\UploadedFile;
use bedezign\yii2\models\AuditTrail;
use bedezign\yii2\audit\models\AuditEntry;
use bedezign\yii2\Audit;
class StudentForm extends \yii\db\ActiveRecord
{

    public function behaviors()
    {
        return [
            'AuditTrailBehavior' => [
                'class' => 'bedezign\yii2\audit\AuditTrailBehavior',
                // Array with fields to save. You don't need to configure both `allowed` and `ignored`
                'allowed' => ['firstname','lastname','email','phone'],
                'active' => true,
                // Date format to use in stamp - set to "Y-m-d H:i:s" for datetime or "U" for timestamp
                'dateFormat' => 'Y-m-d H:i:s',
            ]
        ];
    }

My question is

  1. Why I am getting error like Audit module cannot be loaded ?

  2. Why any error or other logs are not storing into audit tables ?

I have added audit in main.php

'modules' => [
        'audit' => 'bedezign\yii2\audit\Audit',
    ],    

After added I am getting error like below image.

来源:https://stackoverflow.com/questions/45860644/declaration-of-bedezign-yii2-audit-components-panels-datastoragepaneltraitgetu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!