#AskYii: How to include Javascript and CSS file in Yii Framework? | #Yii
@Robert2
Updated July 12, 2013 ● 763 views
Updated July 12, 2013 ● 763 views
Yii channell is about Yii PHP Framework. Yii is a free, open-source Web application development framework written in PHP5 that promotes clean, dry design and encourages rapid development. It works to streamline your application development and helps to ensure an extremely efficient, extensible, and maintainable end product.
If you are a fellow Yii developer, join us! Do not hesitate to share your ideas. If you have a Yii product, you are welcome to share your creation here.
Check out Yii Framework official website.
I want to include Bootstrap files in my view. How can I include it using Yii Framework?
To include Javascript and CSS file in Yii, put the following at the top of your view file:
Ross · 11 years ago$cs=Yii::app()->clientScript;
$baseUrl=Yii::app()->request->baseUrl;
$cs->registerScriptFile($baseUrl."/javascriptfile.js");
$cs->registerCssFile($baseUrl."/cssfile.css");
permalink · reply (0)