[eluser]Unknown[/eluser]
I am building a site which has 13 different categories. When a user clicks one of the categories I'm going to display the records that belong to that category. What's the best way to do this with Codeigniter?
I am retreiving the categories from the database and putting them into a list:
Code:
<ul>
<li>Categories</li>
<?php foreach($categories as $category) : ?>
<li><a href="<?php echo $category->name; ?>"><?php echo $category->name; ?></a></li>
<?php endforeach; ?>
</ul>
When a user clicks on one of these categories how should I process that information?
My first thought is to create a new controller for categories and have a separate function for each category. Is that the best way? Or should I use $this->uri->segment?
Thank you.