Home > Backend Development > PHP Tutorial > System predefined delegation Summary of Yii20 predefined alias functions

System predefined delegation Summary of Yii20 predefined alias functions

WBOY
Release: 2016-07-28 08:27:22
Original
1088 people have browsed it

The examples in this article describe Yii2.0 predefined aliases. Share it with everyone for your reference. The details are as follows:

To summarize here, there are 12 default predefined aliases, including 11 path aliases and only 1 URL alias @web:

@yii represents the directory where the Yii framework is located. It is also the location where the yiiBaseYii class file is located;
@app represents the root directory of the running application, usually digpage.com/frontend;
@vendor represents the directory where the Composer third-party library is located, usually @app/vendor or @app/. ./vendor ;
@bower indicates the directory where the Bower third-party library is located, usually @vendor/bower;
@npm indicates the directory where the NPM third-party library is located, usually @vendor/npm;
@runtime indicates the running of the running application The directory used to store runtime files, usually @app/runtime;
@webroot represents the directory where the entry file index.php of the running application is located, usually @app/web;
@web URL alias, indicating the current The root URL of the application, mainly used for the front end;
@common represents the common folder;
@frontend represents the folder where the front-end application is located;
@backend represents the folder where the background application is located;
@console represents the file where the command-line application is located folder;

Other second-level names registered with Yii extensions installed using Composer.

In this way, in the entire Yii application, as long as the above alias is used, a specific path or URL can be expressed conveniently and uniformly.

Readers who are interested in more Yii-related content can check out the special topics of this site: "Summary of Getting Started with Yii Framework and Common Techniques", "Summary of Excellent PHP Development Framework", "Basic Tutorial for Getting Started with Smarty Templates", "PHP Date and Time Usage" Summary", "php object-oriented programming introductory tutorial", "php string (string) usage summary", "php+mysql database operation introductory tutorial" and "php common database operation skills summary"

I hope that what this article has said will be helpful to everyone PHP programming based on the Yii framework helps.

The above has introduced the system predefined delegation and a summary of the predefined alias function of Yii20, including the content of the system predefined delegation. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template