Codeigniter redirects best approach to choose |
In the same controller i have found there are two ways to redirect.
Class Home extends mY_Controller{ public $view; public $redirect; function first_method { $this->view = FALSE; // $this->second_method(); // redirect('Home/second_method'); } function second_method() { echo 'Second one'; } } I want to know which is the best approach also i have a redirect method in the my_controller if certain conditions do not match redirect the user using redirect variable just for simplicity i am posting this <?php class MY_Controller extends CI_Controller { protected $data; function __construct() { parent::__construct(); } public function _remap($method, $parameters) { if($this->view === FALSE) { redirect($this->redirect); }else{ $this->load->view('my_view'); } } } Using the first method i am unable to access the second line |
Messages In This Thread |
Codeigniter redirects best approach to choose - by SnowranCruzick - 12-20-2022, 03:02 AM
RE: Codeigniter redirects best approach to choose - by KammalJeriya - 03-23-2023, 01:12 AM
|