PageController.php 524 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\controllers;
  3. use app\models\Page;
  4. class PageController extends \yii\web\Controller
  5. {
  6. public $defaultAction = 'page';
  7. /**
  8. * {@inheritdoc}
  9. */
  10. public function actions()
  11. {
  12. return [
  13. 'error' => [
  14. 'class' => 'yii\web\ErrorAction',
  15. ]
  16. ];
  17. }
  18. public function actionPage($id)
  19. {
  20. $page = new Page();
  21. return $this->render('/site/page', [
  22. 'model' => $page->findOne($id),
  23. ]);
  24. }
  25. }