[eluser]Raymondddd[/eluser]
Hi,
I've a problem with the pagination class in combination with some uri's.
I use pagination for my category page, which one handle categories and subcategories
This is a part of de category controller:
Code:
public function readCategory($sParent, $sCategory = false) {
$aData = array('parent' => $sParent, 'category' => $sCategory);
$aData will be send to the category model and de category model will return a list of products:
Code:
$this->category_model->readProductByCategory($aData, $config['per_page'], $this->uri->segment(3))
URL structure:
site.com/category/subcategory
site.com/category
Here is the problem: when i use my pagination in site.com/category, the url will be: site.com/category/10 (10 = offset) but my scripting sees it as a subcategory.
What is the best to prevent this? Would a check for numeric characters in the second parameter be enough?
Anyone a better idea?
Thank a lot!
Raymond