YII Framework学习教程-入门前-2011-11-10

    YII已经更新到v1.1.8了。虽然官方文档,教程已经很好了。但是发现现在用如此之好的框架的人还是很少。于是写点教程,推广一下。


    YII的官方的网址是

   http://www.yiiframework.com/

  官方下载地址是

   http://www.yiiframework.com/download/


    YII的更新还是比较快的。这里用目前最新的v1.1.1作为蓝本。

    http://yii.googlecode.com/files/yii-1.1.8.r3324.tar.gz

  

   解压缩到www目录。目录结构如下:

└── yii
    ├── CHANGELOG
    ├── demos
    ├── framework
    ├── LICENSE
    ├── README
    ├── requirements
    └── UPGRADE


 
建议对一下README。内容如下:

Yii Web Programming Framework
=============================


Thank you for choosing Yii - a high-performance component-based PHP framework.




INSTALLATION
------------


Please make sure the release file is unpacked under a Web-accessible
directory. You shall see the following files and directories:


      demos/               demos
      framework/           framework source files
      requirements/        requirement checker
      CHANGELOG            describing changes in every Yii release
      LICENSE              license of Yii
      README               this file
      UPGRADE              upgrading instructions




REQUIREMENTS
------------


The minimum requirement by Yii is that your Web server supports
PHP 5.1.0 or above. Yii has been tested with Apache HTTP server
on Windows and Linux operating systems.


Please access the following URL to check if your Web server reaches
the requirements by Yii, assuming "YiiPath" is where Yii is installed:


      http://hostname/YiiPath/requirements/index.php




QUICK START
-----------


Yii comes with a command line tool called "yiic" that can create
a skeleton Yii application for you to start with.


On command line, type in the following commands:


        $ cd YiiPath/framework                (Linux)
        cd YiiPath\framework                  (Windows)


        $ ./yiic webapp ../testdrive          (Linux)
        yiic webapp ..\testdrive              (Windows)


The new Yii application will be created at "YiiPath/testdrive".
You can access it with the following URL:


        http://hostname/YiiPath/testdrive/index.php




WHAT's NEXT
-----------


Please visit the project website for tutorials, class reference
and join discussions with other Yii users.






The Yii Developer Team
http://www.yiiframework.com




可以看到,里面有详细的说明了。

讲了目录的结构。

使用YII FARMEWORK之前的lamp开发环境的测试。

创建基于YII的程序的命令的使用方法。

和程序的访问方式。



第一步测试lamp是否适合YII的开发环境

http://www.localyii.com/yii/requirements/

检查内容

本网页用于确认您的服务器配置是否能满足运行Yii Web应用的要求。它将检查服务器所运行的PHP版本,查看是否安装了合适的PHP扩展模块,以及确认php.ini文件是否正确设置。

检查结果

您的服务器配置符合Yii的最低要求。如果您需要使用特定的功能,请关注如下警告。

具体结果

项目名称 结果 使用者 备注
PHP版本 通过 Yii Framework PHP 5.1.0或更高版本是必须的。
$_SERVER变量 通过 Yii Framework  
Reflection扩展模块 通过 Yii Framework  
PCRE扩展模块 通过 Yii Framework  
SPL扩展模块 通过 Yii Framework  
DOM扩展模块 通过 CHtmlPurifierCWsdlGenerator  
PDO扩展模块 通过 所有和数据库相关的类  
PDO SQLite扩展模块 未通过 所有和数据库相关的类 如果使用SQLite数据库,这是必须的。
PDO MySQL扩展模块 通过 所有和数据库相关的类 如果使用MySQL数据库,这是必须的。
PDO PostgreSQL扩展模块 未通过 所有和数据库相关的类 如果使用PostgreSQL数据库,这是必须的。
Memcache扩展模块 未通过 CMemCache  
APC扩展模块 通过 CApcCache  
Mcrypt扩展模块 通过 CSecurityManager This is required by encrypt and decrypt methods.
SOAP扩展模块 通过 CWebServiceCWebServiceAction  
GD extension with
FreeType support
通过 CCaptchaAction  
Ctype extension 通过 CDateFormatterCDateTimeParserCTextHighlighter,CHtmlPurifier  
 通过  未通过  警告

这里我们用mysql数据库,所以其它的数据暂时不用配置。

可以访问

http://www.localyii.com/yii/demos/

查看官方提供例子。

官方的例子看懂了。基本上用YII开发网站没有什么问题了。



一下来讲

如何用yiic快速生成代码。

  

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值