How to redirect to another view from a view |
[eluser]Unknown[/eluser]
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? Code: <?php echo form_open('CodeIgniter_1.7.2/country_search/country_list'); ?> Thanks
[eluser]leonardteo[/eluser]
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: http://ellislab.com/codeigniter/user-gui...ation.html 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, L.
[eluser]pickupman[/eluser]
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. |
Welcome Guest, Not a member yet? Register Sign In |