Welcome Guest, Not a member yet? Register   Sign In
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

class MY_Controller extends CI_Controller
    protected $data;

    function __construct()

    public function _remap($method, $parameters)
        if($this->view === FALSE)


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

Theme © iAndrew 2016 - Forum software by © MyBB