Yii2.0学习--目录结构
目录结构:
创建一个控制器:
1 <?php 2 /** 3 * Created by Haima. 4 * Author:Haima 5 * QQ:228654416 6 * Date: 2018/8/23 7 * Time: 5:36 8 */ 9 10 namespace app\controllers; 11 12 use yii\base\Controller; 13 14 class HomeController extends Controller 15 { 16 public function actionIndex(){ 17 // echo 123; 18 return $this->render('index'); 19 } 20 }
建新view层
访问正常:
http://yii.com/index.php?r=home/index
[Haima的博客]
http://www.cnblogs.com/haima/