Home> PHP Framework> YII> body text

How to load public files in yii

王林
Release: 2020-02-18 11:13:16
Original
2180 people have browsed it

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 theProgramming Introductioncolumn 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!

Related labels:
yii
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!