The examples in this article describe the Yii2.0 predefined aliases. Share to everyone for your reference, specific as follows:
To sum up, there are 12 default predefined aliases, including 11 path aliases, and URL aliases only @web 1:
@yii represents the directory where the Yii framework resides, and also the location of the Yii\baseyii class file;
@app represents the root directory of a running application, typically digpage.com/frontend;
The @vendor represents the directory of composer Third third-party, usually @app/vendor or @app/. /vendor;
The @bower represents the directory of Bower third Third-party, generally @vendor/bower;
@npm The directory of NPM's third third-party, usually @vendor/npm;
@runtime represents the directory where runtime files are stored at runtime for running applications, typically @app/runtime;
@webroot represents the directory in which the entry file for the running application index.php is located, generally @app/web;
@web A URL alias that represents the root URL of the current application, primarily for the front-end;
@common represents a generic folder;
@frontend represents the folder in which the foreground application resides;
@backend represents the folder in which the background application resides;
@console represents the folder where the command line application resides;
Other two-level aliases for YII extension registrations that use composer installation.
Thus, in the entire YII application, a specific path or URL can be easily and uniformly represented as long as the alias is used.
More about Yii related content readers can view the site topics: "Yii framework Introduction and common skills Summary", "PHP Excellent Development Framework Summary", "Smarty Template Primer Tutorial", "PHP date and Time usage summary", "PHP object-oriented Programming Program", " Summary of PHP string usage, Introduction to PHP+MYSQL database operations, and a summary of PHP common database operations Tips
I hope this article will help you with the PHP program design based on the YII framework.