skeeks\cms\controllers\ContentElementController::actionView PHP Method

actionView() public method

public actionView ( )
    public function actionView()
    {
        if (!$this->model) {
            throw new NotFoundHttpException(\Yii::t('skeeks/cms', 'Page not found'));
        }
        $contentElement = $this->model;
        $tree = $contentElement->cmsTree;
        if ($tree) {
            \Yii::$app->cms->setCurrentTree($tree);
            \Yii::$app->breadcrumbs->setPartsByTree($tree);
            \Yii::$app->breadcrumbs->append(['url' => $contentElement->url, 'name' => $contentElement->name]);
        }
        $viewFile = $this->action->id;
        $cmsContent = $this->model->cmsContent;
        if ($cmsContent) {
            if ($cmsContent->viewFile) {
                $viewFile = $cmsContent->viewFile;
            } else {
                $viewFile = $cmsContent->code;
            }
        }
        $this->_initStandartMetaData();
        return $this->render($viewFile, ['model' => $this->model]);
    }