1准备Yii源码
首先新建helloyii目录作为Web应用的根目录,并添加到Nginx的配置文件中。然后将Yii框架源码部署到helloyii下,目录结构如下:
helloyii/
|-- framework
|-- ……
|-- YiiBase.php
|-- yiic
|-- yii.php
`-- zii
2编写HelloWorld
2.1目录结构
程序目录结构如下:
app/
|-- index.php
`-- protected
|-- controllers
| `-- HelloController.php
`-- views
`-- hello
`-- result.php
2.2主要代码
index.php
===============================================================================
<?php
// change the following paths if necessary
$yii=dirname(__FILE__).'/../framework/yii.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of cal