$pagerOptions = array(
'mode' => 'Sliding',
'delta' => 4,
'perPage' => 20,
'firstPageText' => $CFG['lang']['index_page'],
'lastPageText' => $CFG['lang']['last_page'],
'nextImg' => $CFG['lang']['next_page'],
'prevImg' => $CFG['lang']['prev_page'],
'spacesBeforeSeparator' => 1,
'spacesAfterSeparator' => 1,
'extraVars' => array('type_id'=>$type_id,'order_by'=>$order_by,'keyword'=>$keyword, 'title_key'=>$title_key, 'body_key'=>$body_key, 'editor_mark'=>$editor_mark),
'httpMethod' => 'GET',
);
$data_ary = getArticlePagerData($child_id_str, $pagerOptions, $search_key, $order_by);
require_once 'HTML/Table.php';
$tableAttrs = array('width' => '590','align'=>'center', "cellpadding"=>5, "cellspacing"=>0);
$table = new HTML_Table($tableAttrs);
$table->setAutoGrow(true);
$table->setAutoFill(' ');
for ($i = 0; $i < count($data_ary['data']); $i++) {
$table->setHeaderContents($i+1, 0, (string)($i+$data_ary['from']));
.....
}
$DATA_ARY['body'] .= $form->toHtml();
// 注意:此部分可以直接传递变量给smarty模板,这样灵活性更加强。
require_once("mySmarty.class.php");
$tpl = new mySmarty($CFG, $tpl_dir);
// 设置模板变量
$tpl->assign(
array(
"data_ary" => $DATA_ARY,
"web" => $CFG['web'],
)
);
echo $tpl->myFetch('user_index.tpl.html');
// 注意:此处也可以将smarty模板的输出直接生成静态页,HBCMS的前台列表页就是掉用smarty生成的静态页