Welcome Guest, Not a member yet? Register   Sign In
codeigniter get category and subcategory
#2

You will need a route in application/config/routes.php. E.g.:
PHP Code:
$route['category/(:any)'] = 'category/view/$1'

Create a controller named Category.php
Create a method inside it named view, which accepts the category_id as parameter:
PHP Code:
public function view($category)
{
 
 //collect category and subcategories from your database, see documentation about the Query Builder.
 
 //display the data in a view you load, see documentation about loading views


The tutorial about the News section could give you a good start.
Reply


Messages In This Thread
RE: codeigniter get category and subcategory - by Wouter60 - 07-08-2017, 01:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB