Welcome Guest, Not a member yet? Register   Sign In
Pagination class and uri's
#1

[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


Messages In This Thread
Pagination class and uri's - by El Forum - 09-20-2010, 05:41 AM
Pagination class and uri's - by El Forum - 09-20-2010, 05:49 AM
Pagination class and uri's - by El Forum - 09-20-2010, 06:40 AM
Pagination class and uri's - by El Forum - 09-20-2010, 06:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB