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

[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.
#2

[eluser]danmontgomery[/eluser]
Hi Herton,

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

Quote:http://www.yourdomain.com/[controller]/[method]/[parameter]

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

Quote:http://www.yourdomain.com/news/view/128
http://www.yourdomain.com/blog/edit/this-is-a-blog

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
#3

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




Theme © iAndrew 2016 - Forum software by © MyBB