public function actionIndex()
    {
        $dynamicModel = $this->createAuditForm();
        $auditForm = new AuditForm;
        $auditForm->addFormValidators($dynamicModel);
        $dataProvider = null;
        $arrayDiff = [];
        /** @var Module $module */
        $module = $this->module;
        if ($dynamicModel->load(Yii::$app->request->get()) && $dynamicModel->validate()) {
            $this->setCurrentModel($dynamicModel->table);
            $this->hiddenColumns = array_merge(
                $module->auditColumns,
                $module->tables[$dynamicModel->table]['hiddenColumns']
            );
            $dataProvider = $this->createDataProvider($dynamicModel);
            $arrayDiff = [];
            $previousModel = null;
            foreach ($dataProvider->getModels() as $model) {
                $auditId = $model['audit_id'];
                $model = $this->unsetHiddenColumns($model);
                $arrayDiff[$auditId] = $this->createDiff($model, $dynamicModel, $previousModel, $auditId);
                $previousModel = $model;
            }
        }
        return $this->render('index', [
            'model' => $dynamicModel,
            'dataProvider' => $dataProvider,
            'arrayDiff' => $arrayDiff,
            'fields' => $auditForm->getFormFields($dynamicModel),
            'hiddenColumns' => $this->hiddenColumns,
        ]);
    }
public function actionIndex()
    {
        $dynamicModel = $this->createAuditForm();
        $auditForm = new AuditForm;
        $auditForm->addFormValidators($dynamicModel);
        $dataProvider = null;
        $arrayDiff = [];
        /** @var Module $module */
        $module = $this->module;
        if ($dynamicModel->load(Yii::$app->request->get()) && $dynamicModel->validate()) {
            $this->setCurrentModel($dynamicModel->table);
            $this->hiddenColumns = array_merge(
                $module->auditColumns,
                $module->tables[$dynamicModel->table]['hiddenColumns']
            );
            $dataProvider = $this->createDataProvider($dynamicModel);
            $arrayDiff = [];
            $previousModel = null;
            foreach ($dataProvider->getModels() as $model) {
                $auditId = $model['audit_id'];
                $model = $this->unsetHiddenColumns($model);
                $arrayDiff[$auditId] = $this->createDiff($model, $dynamicModel, $previousModel, $auditId);
                $previousModel = $model;
            }
        }
        return $this->render('index', [
            'model' => $dynamicModel,
            'dataProvider' => $dataProvider,
            'arrayDiff' => $arrayDiff,
            'fields' => $auditForm->getFormFields($dynamicModel),
            'hiddenColumns' => $this->hiddenColumns,
        ]);
    }
public function actionIndex ( ) { $ dynamicModel = $ this -> createAuditForm ( ) ; $ auditForm = new AuditForm ; $ auditForm -> addFormValidators ( $ dynamicModel ) ; $ dataProvider = null ; $ arrayDiff = [ ] ; /** @var Module $module */ $ module = $ this -> module ; if ( $ dynamicModel -> load ( Yii :: $ app -> request -> get ( ) ) && $ dynamicModel -> validate ( ) ) { $ this -> setCurrentModel ( $ dynamicModel -> table ) ; $ this -> hiddenColumns = array_merge ( $ module -> auditColumns , $ module -> tables [ $ dynamicModel -> table ] [ 'hiddenColumns' ] ) ; $ dataProvider = $ this -> createDataProvider ( $ dynamicModel ) ; $ arrayDiff = [ ] ; $ previousModel = null ; foreach ( $ dataProvider -> getModels ( ) as $ model ) { $ auditId = $ model [ 'audit_id' ] ; $ model = $ this -> unsetHiddenColumns ( $ model ) ; $ arrayDiff [ $ auditId ] = $ this -> createDiff ( $ model , $ dynamicModel , $ previousModel , $ auditId ) ; $ previousModel = $ model ; } } return $ this -> render ( 'index' , [ 'model' => $ dynamicModel , 'dataProvider' => $ dataProvider , 'arrayDiff' => $ arrayDiff , 'fields' => $ auditForm -> getFormFields ( $ dynamicModel ) , 'hiddenColumns' => $ this -> hiddenColumns , ] ) ; }
Displays list of choosen audit table records

@return string the rendering result
Displays list of choosen audit table records