Open izemize opened 7 years ago
PageController.php
<?php namespace app\controllers; use yii\easyii\modules\page\api\Page; class PageController extends \yii\web\Controller { public function actionView($slug) { $item = Page::get($slug); if(!$item){ throw new NotFoundHttpException('Item not found.'); } return $this->render('view', [ 'item' => $item, ]); } }
page/view.php
<?php use yii\helpers\Url; $this->title = $item->seo('title', $item->model->title); $this->params['breadcrumbs'][] = ['label' => 'Statikus oldalak', 'url' => ['news/index']]; $this->params['breadcrumbs'][] = $item->model->title; ?> <h1><?= $item->seo('h1', $item->title) ?></h1> <?= $item->text ?>
PageController.php
page/view.php