Include CSS javascript file in Yii Framework

In this article, you are going to see how to Include CSS javascript file in Yii Framework.


If you are using Theme then you can the below Syntax


include CSS File :

[css]<link href="<?php echo Yii::app()->theme->baseUrl;?>/css/bootstrap.css" type="text/css" rel="stylesheet" media="all">[/css]

Include JS File

[js]<script src="<?php echo Yii::app()->theme->baseUrl;?>/js/jquery-2.2.3.min.js"></script>[/js]


If you are not using theme



<link href=”<?php echo Yii::app()->request->baseUrl; ?>/css/bootstrap.css” type=”text/css” rel=”stylesheet” media=”all”>


[css]<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery-2.2.3.min.js"></script>[/css]

Add a Comment

Your email address will not be published. Required fields are marked *