Method: getPagination()

Fetch an arry containing all of the variables required to provide pagination links on your result set.

Returns:

ARRAY of pagination parameters

Example:

$this->pagination =  $this->obj_list->getPagination
$this->getWidget('pagination'); // Fetches standard HTML pagination widget from shared codebase

Example 2:

<?php $this->pagination = $this->obj_list->getPagination ?>
<?php if(isset($this->pagination) && is_array($this->pagination)) { ?>
<?php  if($this->pagination['previous'] || $this->pagination['next']) { ?>
	<div style="margin-bottom:10px;">
	<?php  if($this->pagination['previous']) { ?>
	<a href="<?php echo $this->getListLink(array('page' => $this->pagination['previous']))?>" class="btn">
	<?php } else { ?>
	<a class="btn disabled">
	<?php } ?>
	Prev</a>
	
	<?php
		if(!$this->arr_input['page']){
			$this->arr_input['page'] = 1;
		}
	?>
	<?php if($this->pagination['paging_count_start'] && $this->pagination['paging_count_end']){ ?>
	<div class="btn-group">
		<?php for($i=$this->pagination['paging_count_start']; $i<$this->pagination['paging_count_end']; $i++) { ?>
			<a href="<?php echo $this->getListLink(array('page' => $i)) ?>" class="btn<?php
				if($this->arr_input['page'] == $i) { echo ' disabled'; }
			?>"><?php echo $i ?></a>
		<?php } ?>
	</div>
	<?php } ?>
	
	<?php if($this->pagination['next']) { ?>
	<a href="<?php echo $this->getListLink(array('page' => $this->pagination['next']))?>" class="btn">
	<?php } else { ?>
	<a class="btn disabled">
	<?php } ?>
	Next</a>
	
	</div>
<?php } ?>
<?php } ?>

Contact Us

Address: 22a Fishergate York, YO10 4AB · Tel: 01904 636677 · Email: info@dotadmin.com