Advertisement
mixa77551

dynamic pages

Sep 30th, 2014
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php
  2. 'urlManager' => [
  3.     'class' => 'yii\web\UrlManager',
  4.     'enablePrettyUrl' => true,
  5.     'showScriptName' => false,
  6.     'baseUrl' => '/',
  7.     /*'rules' => [
  8.         '<controller:\w+>' => '<controller>',
  9.         '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
  10.     ],*/
  11.     'rules' => [
  12.         '<controller:\w+>'              => '<controller>',
  13.         '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
  14.         '<dir1:[\w\-\_\d]+>'            => 'page/index',
  15.     ],
  16. ],
  17.  
  18.  
  19.  
  20.  
  21. <?php
  22. namespace frontend\controllers;
  23.  
  24. use Yii;
  25. use yii\web\Controller;
  26. use frontend\controllers\BaseController;
  27.  
  28. /**
  29.  * Page controller
  30.  */
  31. class PageController extends BaseController
  32. {
  33.     public function actionIndex()
  34.     {
  35.         return $this->render('index');
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement