This article will illustrate the YII framework with a concrete example that allows readers to learn how to use the YII framework to create their own WEB applications in real-world cases, thus having a more realistic experience with this excellent PHP framework.
What is YII?
Yii is a high-performance, component-based PHP Framework for rapid development of WEB applications.
Yii derives its name from the acronym "Yes It is". This is a sure answer to many questions about the framework: "Is it fast?" Is it safe? Is it strong? Is it suitable for our project? ”
What is Yii suitable for?
Yii is a common lightweight web programming framework that can be used to develop almost all Web applications. With its mature caching mechanism, especially suitable for the development of high flow applications, such as portals, forums, http://www.aliyun.com/zixun/aggregation/10094.html "> Content management System (CMS), E-commerce systems and so on."
What are the advantages of Yii versus other software?
Like most PHP frameworks, Yii is an MVC framework that allows developers to easily modify without affecting other parts by separating the business logic from the user interface.
YII uses and integrates many other well-known web programming frameworks and applications in design, taking into account the needs of Web application development to the greatest extent possible. So Yii makes it stand out from the many PHP frameworks in terms of superior performance, rich functionality, and clear documentation.
Installation and configuration of YII
Pre-Installation Preparation
Before installing and using YII, you need to have an environment that installs PHP and WEB servers. At present, there are many integrated environment software can easily implement this part of the installation. Like the wampserver we use here. You can download and install it from the official website of Wampserver. Wampserver installation is very simple, double-click to execute on it. During installation, it will automatically install Apache, MySQL, and PHP for you, without any additional configuration, everything is easy and easy to accomplish.
Installation of Yii
The installation of YII is so simple that you can hardly imagine it, just perform the following two steps and start using it.
One: Download the YII framework from the official website of Yii
Two: Unzip the downloaded file into a Web-accessible folder
If you want to verify that Yii was installed successfully, simply enter the following URL in the browser.
http://hostname/path/to/yii/requirements/index.php
Here is the page that we see from the browser.
Figure 1. YII Installation Successful page display