Home >PHP Framework >YII >How to load public files in yii

How to load public files in yii

王林
王林Original
2020-02-18 11:13:162389browse

How to load public files in yii

The layout file of Yii2 can generally satisfy the loading of most public files, but there are still some situations where it cannot be satisfied, such as a common part in some pages. The situation is more difficult to handle.

Related tutorial sharing: yii framework

The following is the solution for loading public files:

1. Use JS to define public methods and use them when needed Load the loaded page;

2. Use widgets (Widgets) to define widgets to perform loading;

3. Use beginContent to load the file directly.

The public part is static. Just choose the corresponding method according to the actual situation.

For more programming related content, please pay attention to the Programming Introduction column on the php Chinese website!

The above is the detailed content of How to load public files in yii. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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