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...