@darion
In CodeIgniter, you can redirect from a view to a controller by using the URL helper function redirect().
Here's an example of how you can redirect from a view file to a controller:
1 2 3 4 |
<?php // Redirect to the 'example_method' method in the 'Example_controller' controller redirect('example_controller/example_method'); ?> |
Note: Make sure to load the URL helper in your controller before using the redirect() function. You can load the URL helper in your controller using the following code:
1
|
$this->load->helper('url'); |
By following these steps, you can easily redirect from a view to a controller in CodeIgniter.