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

Yii::app()->theme->baseUrl

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

Yii::app()->request->baseUrl

[js][/js]

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

[js][/js]

[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 *