Exemplo n.º 1
0
<?php

header("content-type:text/html;charset=utf-8");
include_once 'smarty/Smarty.class.php';
include_once 'dbio/NewsTypes.php';
include_once 'dbio/NewsArticles.php';
$smarty = new Smarty();
//获得url中的typeId
$typeId = $_GET["typeId"];
$newsTypes = NewsTypes::getNewsTypes();
//所有分类
$newsInfo = NewsArticles::getNewsInfoByTypeId($typeId);
//当前分类下所有新闻
$newsType = NewsTypes::getNewsType($typeId);
//该分类的详细信息
$smarty->assign("newsType", $newsType);
$smarty->assign("newsInfo", $newsInfo);
$smarty->assign("newsTypes", $newsTypes);
$smarty->display("newstype.html");
?>