How to create static pages using action() method?

How to create static pages using action() method ?

https://www.yiiframework.com/doc/api/2.0/yii-web-viewaction

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

image

3. update routing rule

'<view>' => '/site/pages'

4. Create Static view under views/site