#1 小双
地址是:http://localhost/index.php?c=test&a=index&typeid=10&page=1如何生成html静态分页?
下面是分别生成栏目静态页和分页page静态分页的代码:
//地址:http://localhost/index.php?c=test&a=index&typeid=10
$urls = array();
if( $result = spClass("lib_type")->findAll(array('typeid'=>3))){
foreach($result as $value){ // 循环
$urls[] = array(
array('test','index',array('typeid'=>$value['id'])) // 这里和spUrl的参数是相同的
);
}
}
spClass('spHtml')->makeAll($urls); // 使用makeAll来制作
//****************************************************
//地址: http://localhost/index.php?c=test&a=index&page=1
$urls = array();
$o = spClass("lib_cms");
$total = $o->findCount();
$perpage = 5;
$pagenum = ceil($total/$perpage);
for($i = 1;$i <= $pagenum;$i++){
$urls[] = array(
array('test','index',array('page'=>$i))
);
}
spClass("spHtml")->makeAll($urls);
上面代码是分开地址的情况生成html的,而现在的地址是他们的集合,比如:
地址是:http://localhost/index.php?c=test&a=index&typeid=10&page=1
要怎么整合上面的代码还是写其他的代码?
2010-05-25 11:36:29