Controller目录下创建TestController.php
Copy the code below, yii is the same as tp, with full namespace
<?php namespace app\controllers; use yii\web\Controller; class SiteController extends Controller { // ...existing code... public function actionSay($message = 'Hello World') { return $this->render('say', ['message' => $message]); } }
Create a test folder in the view folder and create say.php under the folder
Copy the following code to say.php
46d32f1990b68e4dcdc5ffa50c980a0e f62bfd67e0b24503a85b3b91d1829d4e
Visit your first page, url/basic/web/index.php?r=test%2Fsay, test is the controller and say is the method
Note, the header file comes with it, we will introduce how to modify it later.