Welcome Guest, Not a member yet? Register   Sign In
How to redirect to another view from a view

Hey folks,

new to CI, just need some insight. I have a view with a form using the form helper, now what do I set the target to to redirect it to another view? would I need to redirect back to the controller?

<?php echo form_open('CodeIgniter_1.7.2/country_search/country_list'); ?>


Yeah you always call a controller, which then calls the views you want.

Take a look at this page on using the form_validation class:

That should shed some insight on using a single controller function to control which views are shown based on whether the user has posted valid content in the form.

Good luck,


Don't think of views as part of the url. You can have as many views you want for a url. CI just loads each one you call. Form urls should go to your controller/method.

Theme © iAndrew 2016 - Forum software by © MyBB