Home / Yii / Create Yii theme from scratch

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>

About Mohammad Fareed

Software Engineer @ Tekzenit.

Check Also

Yii Framework – Generate Models, Controllers and Views

Yii Framework – Generate Models, Controllers and Views Post Views: 80

Leave a Reply

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