Create Yii theme from scratch

Create Yii theme from scratch
Configure Yii Themes in your Application

 

If you are using Theme then you can the below Syntax

Yii::app()->theme->baseUrl
include CSS File :

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

<script src=”<?php echo Yii::app()->theme->baseUrl;?>/js/jquery-2.2.3.min.js”></script>
If you are not using theme

Yii::app()->request->baseUrl
Use Like this

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

Add a Comment

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