How to create static pages using action() method ?
How to create static pages using action() method ?
Example With Site Controller
1. Update actions Method
public function actions() { return [ 'error' => [ 'class' => 'yii\web\ErrorAction', ], 'captcha' => [ 'class' => 'yii\captcha\CaptchaAction', 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, ], 'pages' => [ 'class' => 'yii\web\ViewAction', ], ]; }
2. Create Directory “pages” under views/site
3. update routing rule
'<view>' => '/site/pages'
4. Create Static view under views/site