Yii2 deep learning-entry file, yii2 deep learning portal-PHP Tutorial

Source: Internet
Author: User
Tags autoload
Yii2 deep learning-entry file, yii2 deep learning portal. Yii2's deep learning-entry file. some time before yii2's deep learning portal, I tried to write a simple php Framework. I found that I still lacked a lot and I stopped it for now. Prepare to read the Yii2 deep learning-entry file and yii2 deep learning portal.

Some time ago, I tried to write a simple php framework and found that I still lacked a lot, so I stopped it temporarily. Prepare to read the Yii2 source code first, then read the laravel source code, and then continue to write this simple php framework.

Later, Yii2 learning is based on basic projects.

Let's take a look at the Yii2 entry file. When configuring nginx for Yii2

    # server_name mysite.local;    root        /path/to/basic/web;    ......    location / {        # Redirect everything that isn't a real file to index.php        try_files $uri $uri/ /index.php?$args;    }

The web entry file is the index. php file in the web folder.

The content of the index. php file is as follows:

 Run ();

We can see that the core code is the last sentence. all of our requests are processed by calling and executing the run method. the specific internal content will be explained later.

Yii2 actually has another entry, which is the Yii2 command line entry file, that is, the yii file under the top-level Directory.

The yii file contains the following content:

#! /Usr/bin/env php
 Run (); // exit ($ exitCode );

The biggest difference with the index. php file is that it uses the yii \ console \ Application class, and the yii \ web \ Application used in index. php.

This is the two portals of Yii2. if it is an advanced project, there will be more portals, but the basic content is one of these two forms.

Today is just a simple opening. let's get started first.

If you are interested in Yii2 source code, you can pay attention to the project yii2-2.0.3-annotated. now you have added a lot of comments about Yii2 source code, and will continue to add ~

If you are interested, you can also participate in the submission of comments from the Yii2 source code.

Some time ago, I tried to write a simple php framework and found that I still lacked a lot of it, so I stopped it for now. Prepare to read...

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.