include_once WEB_PATH."/class/PageBar.php"; $counter = 20 ;//每頁顯示幾筆資料 $pages = 10 ; //分頁工具呈現幾頁 $PageBar = getPageBar($sql, $counter, $pages); $total = $PageBar['total'];//得到總筆數 $sql = $PageBar['sql'];//重新得到sql語法 $bar = ($total > $counter)?$PageBar['bar']:"";//顯示總筆數 > 每頁顯示幾筆資料 ,則出現分頁 $smarty->assign("bar", $bar);//將分頁送至樣板 $smarty->assign("total", $total);//將總筆數送至樣板
{$bar}