log date: 2012.4.25
前提条件:已经安装好了xmapp和yii
0. 修改C:\xampp\apache\conf\httpd-xampp.conf
加入以下内容Alias /yii "C:/xampp/yii/"
<Directory "C:/xampp/yii">
AllowOverride AuthConfig
</Directory>
修改以下语句,加入yii
<LocationMatch "^/(?i:(?:xampp|licenses|phpmyadmin|webalizer|server-status|server-info|yii))">
1. 生成web项目目录
C:\xampp\yii> .\framework\yiic webapp power
2.生成程序
C:\xampp\yii\power> ..\framework\yiic shell
>> controller message helloWorld
3. 编辑程序文件
Edit the file protected/views/message/helloWorld.php
so that it contains just thefollowing code:
<?php
$this->breadcrumbs=array(
'Message'=>array('message/index'),
'HelloWorld',
);?>
<h1>Hello, World!</h1>
<h3><?php echo $time; ?></h3>
Edit the file protected/controllers/MessageController.php
add the following two lines to function actionHelloWorld()
and remove the old one:
$theTime = date("D M j G:i:s T Y");
$this->render('helloWorld',array('time'=>$theTime));
4. you can visit:
http://localhost/yii/power/index.php?r=message/helloWorld
>>> End of hello world <<<