Shane
Shane

Reputation: 25

Installing theme for Yii Application

i'm new to Yii . i have downloaded one theme from "yii.themefactory.net" and i placed it in main configuration of my application.

i know that view is separate from model and controller and all operation in my application but im wondering how this new theme will be match to my controllers and models ,, do i have to add any codes in other directories ,,

i must say mmy question is general ,, i just started using Yii . i have no idea how yii corresponds to theme.

please make me clear and tell me which sources are better so download theme

Upvotes: 1

Views: 1225

Answers (1)

M I
M I

Reputation: 3682

If you are thinking to add theme like Joomla or WordPress. YII is not like that. In your Application's there is a layout folder inside views. In layout there is main.php.

Main.php in Layouts

Add your Header, footer and top menu HTML code here. and inplace of content

<?php echo $content; ?>

Links to the CSS / JS / Images should be like this.

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

You need to add <?php echo Yii::app()->request->baseUrl; ?>/ for path.

View Files Inside View add the content you want in that page.

Controller: In your controller do like this

    public $layout='//layouts/main';

Hope this helps.

Upvotes: 1

Related Questions