Creating a route function and loading specific views

I am going to have a route like listings/$1/$2 but I am not sure what the best way to construct the function is I am wanting to do something like this:

Example:

        $details = $this->createUrl();
        $category = array();

        foreach ($details as $segment) {

            $category[] = array('mainCat' => $segment['mainCat'], 'subCat' => $segment['subCat']);
        }

if($category['mainCat'] && $category['subCat'] == foo/bar)
{
   $this->load->view();
}

Current:

$details = $this->createUrl();
        $category = array();

        foreach ($details as $segment) {

            $category[] = array('mainCat' => $segment['mainCat'], 'subCat' => $segment['subCat']);
        }

Leave a Reply

*

Hire Me
Follow Me!
Search
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.
Categories