1.下载模版http://pan.baidu.com/s/1mgLtvzq
2.protected\views\index,新建index.php,head.php,left.php,right.php,将后台对应的HTML文件内容复制进去
3.assets\default中新建css,images,js三个文件夹,将对应的css,js和图片文件复制进去
4.protected\config中新建constant.php
<?php
/*设置系统常量*/
define('SITE_URL','http://这里写当前域名/');
define('CSS_URL',SITE_URL."assets/default/css");
define('IMG_URL',SITE_URL."assets/default/images");
?>
5.根目录下index.php中
require_once($yii);
前,增加
require_once (dirname(__FILE__).'/protected/config/constant.php');
6.将head.php,left.php,right.php中的CSS路径替换为
<?php echo CSS_URL; ?>,如:
<?php echo CSS_URL; ?>/admin.css;
图片路径替换为<?php echo IMG_URL; ?>,如:<?php echo IMG_URL; ?>/header_right.jpg;
css文件中的"../img"替换为"../images"
7.将index.php中的
"head.html"替换为"./index.php?r=index/head"
"left.html"替换为"./index.php?r=index/left"
"right.html"替换为"./index.php?r=index/right"
8.新建IndexController.php,
<?php
class IndexController extends Controller{
function actionIndex(){
//通过控制器方法调用视图
$this->renderPartial('index');
}
function actionHead(){
$this->renderPartial('head');
}
function actionLeft(){
$this->renderPartial('left');
}
function actionRight(){
$this->renderPartial('right');
}
}
?>
完成,效果如下: