Welcome Guest, Not a member yet? Register   Sign In
more one controller

[eluser]Herton Vilarim[/eluser]
hello, my name is Herton!

i'm from Brazil this is first post on forum, i look examples one controller, i care to look examples how is use two or more controllers on my site. Sorry my bad english.

Hi Herton,

You can create as many controllers as you'd like, you just use the URI structure:


This is assuming CI is installed in webroot (/) and .htaccess is used to remove index.php

For example, if you have a "News" controller and a "Blog" controller, you might access each of them this way


The first would look for:

Controller: News
Method: view()
Parameter: 128

The second for:

Controller: Blog
Method: edit()
Parameter: "this-is-a-blog"

You can pass as many parameters as you'd like, or define custom routing to specify how this parameters will be passed. http://ellislab.com/codeigniter/user-gui...uting.html

[eluser]Herton Vilarim[/eluser]
thank you!

Theme © iAndrew 2016 - Forum software by © MyBB