Home> PHP Framework> YII> body text

How to create applications in yii framework

(*-*)浩
Release: 2019-12-30 09:31:22
Original
2151 people have browsed it

How to create applications in yii framework

In order to have a preliminary understanding of Yii, let’s talk about how to build the first Yii application. We will use the powerful yiic tool, which is used to automatically generate various codes. Assume that YiiRoot is the installation directory of Yii. (Recommended learning:yii framework)

Run yiic on the command line, as shown below:

% YiiRoot/framework/yiic webapp WebRoot/testdrive
Copy after login

Note: On MacOS, Linux or Unix When running yiic in the system, you may need to modify the permissions of the yiic file to enable it to run. You can also use php YiiRoot/framework/yiic.php instead of yiic.

This will create a basic Yii application in the WebRoot/testdrive directory. WebRoot represents the root directory of your Web server. The application has all the necessary directories and files, so it's easy to add more functionality to it.

Without writing a line of code, we can access the following URL in the browser to take a look at our first Yii application:

http://hostname/testdrive/index.php
Copy after login

As we can see, this The application contains three pages: home page, contact page, and login page. The home page displays some information about the application and the user's login status, the contact page displays a contact form for users to fill out and submit their inquiries, and the login page allows users to first authenticate and then access authorized content.

Check out the screenshots below to learn more:

Homepage

How to create applications in yii framework

Contact Page

How to create applications in yii framework

Login Page

How to create applications in yii framework

The above is the detailed content of How to create applications in yii framework. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
yii
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!