public function run($id)
    {
        /** @var ActiveRecord $model */
        $model = $this->findModel($id);
        if ($this->checkAccess) {
            call_user_func($this->checkAccess, 'read', $model);
        }
        //create and cache proper query for breadcrumbs and maybe other things
        $this->getQuery($this->getSearchModel());
        // this headers is used in a modal dialog when getting a redirect after saving a form
        Yii::$app->getResponse()->getHeaders()->set('X-Primary-Key', $id);
        return [
            'model'      => $model,
            'attributes' => $this->getDetailAttributes($model, $this->getFields($model, 'detail')),
            'relations'  => $this->getModelRelations($model, $this->getExtraFields($model)),
        ];
    }
public function run($id)
    {
        /** @var ActiveRecord $model */
        $model = $this->findModel($id);
        if ($this->checkAccess) {
            call_user_func($this->checkAccess, 'read', $model);
        }
        //create and cache proper query for breadcrumbs and maybe other things
        $this->getQuery($this->getSearchModel());
        // this headers is used in a modal dialog when getting a redirect after saving a form
        Yii::$app->getResponse()->getHeaders()->set('X-Primary-Key', $id);
        return [
            'model'      => $model,
            'attributes' => $this->getDetailAttributes($model, $this->getFields($model, 'detail')),
            'relations'  => $this->getModelRelations($model, $this->getExtraFields($model)),
        ];
    }
public function run ( $ id ) { /** @var ActiveRecord $model */ $ model = $ this -> findModel ( $ id ) ; if ( $ this -> checkAccess ) { call_user_func ( $ this -> checkAccess , 'read' , $ model ) ; } //create and cache proper query for breadcrumbs and maybe other things $ this -> getQuery ( $ this -> getSearchModel ( ) ) ; // this headers is used in a modal dialog when getting a redirect after saving a form Yii :: $ app -> getResponse ( ) -> getHeaders ( ) -> set ( 'X-Primary-Key' , $ id ) ; return [ 'model' => $ model , 'attributes' => $ this -> getDetailAttributes ( $ model , $ this -> getFields ( $ model , 'detail' ) ) , 'relations' => $ this -> getModelRelations ( $ model , $ this -> getExtraFields ( $ model ) ) , ] ; }
Displays a model.
@param string $id the primary key of the model.
@return \yii\db\ActiveRecordInterface the model being displayed
Displays a model .