Notes On <Agile Web Application Development with Yii 1.1 and PHP5> - 01

来源:互联网 发布:手机淘宝优惠券在哪里 编辑:程序博客网 时间:2024/05/01 11:01

Get started with Yii:


Installation


The steps were just following the instructions in this reference book.

1. Download the package from: link, the file I get is yii-1.1.2.r2086p.zip;

2. Upzip it and dump all the content into my yii folder: C:\xampp\htdocs\yii\;

3. Run the page of requirement verification: http://localhost/yii/requirements/index.php:

yii-requirement-verification


Create New Application


According to the book, run the command: 


run-command-new-app-fail


So, I add the php installation directory to PATH system variable. Then run the command again:


run-the-command-again


run-new-app-suceed


After the command execuated successfully, there are folders and files created under the directory: WebRoot/yiistudy/

generated-files-for-new-app


And access it in browser is as:

access-new-app


Create Message Controller with outputting 'helloWorld'


Explore the commands with 'help' command:

help-cmd


help-command


Generate a controller with command 'controller':

generate-controller


As I see, this command generate a controller named 'MessageController', and with one action 'actionHelloWorld'.


We can view this new controller and its action by accessing: http://localhost/yiistudy/index.php?r=message/helloworld

new-controller




原创粉丝点击