Welcome Guest, Not a member yet? Register   Sign In
Generating a url that leads to a different controller
#1

[eluser]kpagcha[/eluser]
Hello, I have a form in my main page (index function), when you send it it is supposed to load another view. Formerly I creathed this view to be displayed with the function my_function() in the same controller.

The problem I am having is that either calling the function or loading directly the view my_function is supposed to display from the index, the URL doesn't change.

Let me explain myself:

I am in
Code:
localhost/myweb/mycontroller/index
and here it leads me what should be
Code:
localhost/myweb/mycontroller/myfunction/parameter1/parameter2
but it just stays in the original URL!

How can I generate the URL I want?
#2

[eluser]Massaki[/eluser]
You could use redirect() instead of $this->your_method()
#3

[eluser]Tpojka[/eluser]
Can you show the (wrap it in code tags) code?
#4

[eluser]kpagcha[/eluser]
Thanks for your replies. Both loading the view and using redirect work, I was just using it in a wrong way.
#5

[eluser]anthony_d_mays[/eluser]
You can also configure routes in application/config/routes.php file. Check out URI Routing the User Guide.
#6

[eluser]InsiteFX[/eluser]
CodeIgniter User Guide - URL Helper anchor tag




Theme © iAndrew 2016 - Forum software by © MyBB