0

I'm building a website using CodeIgnitier.

My problem is how can I use the MVC pattern inside a webpage. Let's say I have a controller called "Settings", Within this page I want to divide the settings into categories, with tabs, like "System", "User" and so on.

I know how to do this in the usual way, something like "settings?tab=system" and then load the proper view according to the tab selected. But I want to make a separate MVC pattern for this settings page, is it possible? and how?

tereško
  • 58,060
  • 25
  • 98
  • 150
Yaakov
  • 184
  • 1
  • 8

1 Answers1

1

Basically the thing you are looking for is can be controlled using routes.ini or Route.php. The tab can be your querystring. Settings can be a controller and u can have an action called index which can be controlling it.

chandresh_cool
  • 11,753
  • 3
  • 30
  • 45
  • Do you have any link that explain it in more details? – Yaakov Apr 22 '13 at 12:42
  • This might be helpful http://stackoverflow.com/questions/7618633/routes-in-codeigniter-automatically – chandresh_cool Apr 22 '13 at 12:44
  • 1
    This might be more helpful http://ellislab.com/codeigniter/user-guide/general/routing.html – chandresh_cool Apr 22 '13 at 12:44
  • Thanks. But is it the only way? is it possible to do this with pure MVC approach? – Yaakov Apr 22 '13 at 12:46
  • Well if you look at pure concept of MVC routing is used to hide the main url like hiding /controllername/actionname. So I wud say use routes as it hides your actual code location. Other way what u want is u directly type in ur address bar as controllername/actionname/?querystring – chandresh_cool Apr 22 '13 at 12:59