Paging implement is very simple and flexible because of paging data and html page are seperated.
views/include/paging.html is a sample for paging design.
For the paging , you need to initialize the paging helper for current value and link , etc..
First param is current value of Get "c".
Second param is link.
Third param is current value link.
Fourth param is number of display.
* Paging initialize must be called before load Controller.
Url : http://www.thuleframework.com/forum/board?type=1&c=1
$FE->loadHelper(array("paging","uri","date"));
$FE->Paging->initialize($FE->Uri->getRequest("c"),$FE->Uri->makeLink(2,"type")."&c=",10);
Just simplely call the display function
echo $FE->Paging->display();
$this->loadHelper("paging");
$this->loadModel(array("forum"),$hconn);
$this->Paging->setTotalRows($this->Forum->select_board_post_list_totalrows($boardType)); // set the total rows
$rs=$this->Forum->select_board_post_list($boardType,$this->Paging->pagingQuery()); //pass the paging limit query
function select_board_post_list($boardType=1,$paging=NULL) {
$arrSql=array(
'sql_key'=>'select_forum_board_post_list',
"query_values"=>array($boardType,$paging));
return $this->select($arrSql,QUERY_STATIC);
}
first ? is for $boardType and second ? is for paging limit.
select .. where b1.board_type=? ?
//First page
<a href="?php echo $link?><?php echo $first_pos;?>"> << </a>
// Previous page
<a href="<?php echo $link?><?php echo $previous_pos;?>"><</a>
// pages
<?php for ($i=$start_pos;$i<=$end_pos;$i++): ?>
<?php if($i==$cur_pos): ?>
<a href="<?php echo $link?><?php echo $i;?>"> <b><?php echo $i;?></b> </a>
<?php else :?>
<a href="<?php echo $link?><?php echo $i;?>"> <?php echo $i;?> </a>
<?php endif ?>
<?php endfor ?>
// Next Page
<a href="<?php echo $link?><?php echo $next_pos;?>"> > </a>
// Last Page
<a href="<?php echo $link?><?php echo $last_pos;?>"> >> </a>