#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 ); } }
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!