无意中发现一篇文章,
http://www.autoit.cn/index.php/content/view/103/25.html
对我很有帮助,可以不用模板指派实现,只用一个模板,然后用条件判断语句来实现不同的内容用不同的版面风格
我修改后的代码如下:
文件:index.php
<?php defined( "_VALID_MOS" ) or die( "Direct Access to this location is not allowed." );
switch ($option){
case "com_frontpage":
require_once( "index_front.php");
break;
case "com_content":
switch ($task)
{
case "view":
require_once( "content.php");
break;
case "category":
require_once( "content_category.php");
break;
default:
require_once( "default.php" );
break;
}
break;
default:
require_once( "default.php" );
break;
}
?>
[
本帖最后由 buctjie 于 2007-2-12 09:13 编辑 ]