"Yii Framework One" PHP Framework, Yii overview

Source: Internet
Author: User
Tags php language php framework yii

PHP framework, only exposed to three kinds: thinkphp, Laravel, Yii, the first two to understand, the project uses YII.a brief description of 3 frameworks

1. thinkphp

Thinkphp is the first PHP project I published the framework, then was just contact with the PHP language, the directory structure is simple, mainly three parts: application (application directory), public (resource file), thinkphp (framework directory), Plus a portal file index.php ... Finally, the framework was abandoned and replaced by Laravel.

Thinkphp (TP) is a fast, compatible and simple, lightweight, native PHP framework that needs to be supported by the PHP5.0 version. It was transplanted from the struts structure and improved and perfected, at the same time drawing on a lot of excellent foreign frameworks and models, incorporating struts ideas, tablib tag Library, ORM Mapping and ActiveRecord mode.

2. Laravel

Laravel's Chinese information is relatively small, the video is mostly English, followed by a few episodes of English materials, and then to the end of the tragedy, so English has to learn.

Laravel is a concise, elegant phpweb development Framework (PHP webframework). It frees you from the messy code of noodles, and it helps you build a perfect web app, and every line of code can be concise and expressive.

3. Yii

Yii in the domestic use rate is relatively high, the relevant community has several, rich content, maintenance of a lot of people. In the PHP framework rankings, Yii's share is not laravel so high, but on the available information and difficulty, a short time to get started PHP project, this framework is still very good choice.

Yiiframework is a high-performance PHP framework for developing large Web applications based on components. Yii is one of the most efficient PHP frameworks, providing almost everything you need for today's Web2.0 application development.

In a word, thinkphp domestic use more, if is the novice elect Thinkphp;laravel international recognition degree is higher, start slowly, but get started after Yimapingchuan (a phper said); Yii, this word is good, anyway I am also a PHP rookie one, want it!

Ii. Introduction and use of YII framework1. Introduction to Yii composition

The framework in YII is in the framework, to the official website of yii to download the source file, unzip it can see its directory structure as follows


The core functionality is in the framework, which contains base (framework core components), caching (cache component), DB (Database component), GII (code Auto-generated component), logging (log component) ... Wait, the basic function that needs to be used to encapsulate the almost.


2. Project Construction

When building a project, simply copy the framework into the project folder and then execute YIIC with the cmd command in the framework directory to create the project

1) Go to the command prompt interface and move to the framework

2) using YIIC, create the project, Datasystem is the project name. When it asks if it is created, respond "yes"


3) After successful creation, the "Datasystem" directory is automatically generated in the project folder, which is where our project is located. Of course, we can also create multiple PHP projects here


The above is the process of creating a project framework through YII Scaffolding, very simple

3. Framework use

In the Datasystem directory, assets place static files, CSS styles, images pictures, protected are protected files (no direct access), and index.php are program entry files.


Visit index.php page, is our common Welcome page ~ (To access the content in protected, must go through index.php)


In the protected directory, MVC is going to be on the pitch.


1) Models, views, controllers is the three major components of MVC, do not understand the MVC framework points here

2) config is the relevant configuration file, including database, System constants, main main configuration file, etc., is a

3) components are applications

4) Runtime is the log information generated by the operation

After understanding the basic context, you can then develop the code

Summary:

Described above is the use of YII1, the majority of enterprises are now switching to YII2, overall, a lot of improvements, interested can try.

"Yii Framework One" PHP Framework, Yii overview

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.