Yii2.0 pre-defined alias function summary, yii2.0 alias Summary

Source: Internet
Author: User

Yii2.0 pre-defined alias function summary, yii2.0 alias Summary

This example describes the predefined alias Yii2.0. We will share this with you for your reference. The details are as follows:

Here, we will summarize that by default, there are a total of 12 pre-defined aliases, including 11 path aliases and only one URL alias @ web:

@ YiiIndicates the directory where the Yii framework is located and the location where the yii \ BaseYii files are located;
@ AppIndicates the root directory of the running application, which is generally digpage.com/frontend;
@ VendorIndicates the directory where the Composer third-party library is located, generally @ app/vendor or @ app/../vendor;
@ BowerIndicates the directory where the third-party library of Bower is located, which is generally @ vender/bower;
@ NpmIndicates the directory where the NPM third-party library is located, generally @ vendor/npm;
@ RuntimeIndicates the directory where the running application is used to store the running files, which is generally @ app/runtime;
@ WebrootIndicates the directory where index. php is located in the entry file of the running application, which is generally @ app/web;
@ WebURL alias, indicating the root URL of the current application, mainly used for the front-end;
@ CommonIndicates a common folder;
@ FrontendThe folder where the foreground application is located;
@ BackendThe folder where the background application is located;
@ ConsoleThe folder where the command line application is located;

Other secondary aliases registered by Yii extension installed using Composer.

In this way, the preceding alias can be used throughout the Yii application to conveniently and uniformly represent a specific path or URL.

Related Article

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.