Yii (yiiframework) framework (II): build the first Yii application

Source: Internet
Author: User
Tags zts
Yii (yiiframework) framework (II): The Yii Framework has been installed before the first yii application is established. now, we have installed the Yii Framework before the first yii application, now let's build the first Yii application.

1. go to your website to change the Directory

2. run the command: YiiRoot/framework/yiic webapp testdrive.

Note: YiiRoot here is the installation directory of your Yii Framework.

3. after you enter the preceding command, a message is displayed:


PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/php_pdo_mysql.dll' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/php_pdo_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0Create a Web application under '/home/wwwroot/test.yii.com/'? (yes|no) [no]:

If you want to install a web application in this directory, enter yes to create the application.

4. access your application: http: // hostname/index. php. we can see an application that includes the home page, related page, contact page, and logon page.


5. Application directory structure:


| -- Assets contains public resource files | -- css contains CSS files | -- bg.gif | -- form.css | -- ie.css | -- main.css | -- print.css | '-- screen.css | -- images contains image files | -- portal script file used for index-test.php functional testing | -- index. phpWeb application portal script file | -- protected contains the protected application file | -- commands contains the custom 'yic' command | '-- shell contains the custom 'yiic shell' command | -- components contains reusable user components | -- Controller. basic classes of all php controller classes | '-- UserIdentity. the 'Identity 'class used for php authentication | -- config contains the configuration file | -- console. php console application configuration | -- main. PHP web application configuration | '-- test. configuration used for php function testing | -- controllers class file containing the controller | '-- SiteController. default php controller class file | -- data contains sample database | -- schema. mysql. SQL example MySQL database | -- schema. sqlite. SQL example SQLite database | '-- testdrive. db example SQLite database file | -- extensions contains third-party extensions | -- messages contains translated messages | -- migrations | -- models contains model class files | -- ContactForm. php 'Contact 'action form model |' -- LoginForm. php 'login' action form model | -- runtime contains temporary files | -- tests contains test scripts | -- WebTestCase. php | -- bootstrap. php | -- fixtures | -- functional | '-- SiteTest. php | -- phpunit. xml | -- report | '-- unit | -- views contains the controller's view and layout file | -- layouts contains the Layout view file | -- column1.php uses a single column page layout used | -- layout used by column2.php for pages with double rows | '-- main. default layout of all views in php | '-- site contains the view file of the 'site' controller | -- contact. php 'Contact 'Action view | -- error. php 'error' action View (displaying external errors) | -- index. php 'index' action View | -- login. php 'login' action View | '-- pages contains "static" pages |' -- about. php "about" page view | -- yiicyiic command line script | -- yiic. yiic command line script in batWindows | '-- yiic. phpyiic command line PHP script '-- themes contains the application topic' -- classic '-- views | -- layouts | -- site' -- system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.