Home> PHP Framework> YII> body text

How does the Yii framework reference JS and CSS files?

Guanhui
Release: 2020-06-04 11:57:49
Original
2585 people have browsed it

How does the Yii framework reference JS and CSS files?

#How does the Yii framework reference JS and CSS files?

First put the CSS and JS files in the web directory; then open the "AppAsset.php" file and rewrite the "registerAssetFiles" method; then change the CSS and JS file paths in this method Register; finally call the parent method.

Sample code

css = [ "bootstrap/css/bootstrap.min.css?v={$release}" ]; $this->js = [ 'jquery/jquery.min.js', 'bootstrap/js/bootstrap.min.js' ]; parent::registerAssetFiles( $view ); } }
Copy after login

Recommended tutorial: "Yii Tutorial"

The above is the detailed content of How does the Yii framework reference JS and CSS files?. 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!