• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
codeigniter get category and subcategory

Hello Im new in code igniter 

i want to display category and subcat of this category

when i enter url 


[Image: 3r-GJelHTi2__qj0HnRhvg.png]

sorry for my bad english

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.

I think this is what your looking for.


Download Code:
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.