I have a controller that has a method. The code is too long in the method, so I have put some of the codes in other private methods, so that methods become understandable and not make a mess out of it.

Now, when I access the public method from the URL, depending on parameters, it will call a specific private method to process the job. After the job is processed, I want to redirect to a URL, but the redirection is not working.

A sample of my code is as follows:

class SomeClass extends BaseController{
    public function getMethodName()
        {
            //check the params and choose a private method to call
            $this->processJob();
        }
    private function processJob()
    {
         //process the job and redirect at the end
         return Redirect::to('some/url');
    }
}

The problem is, the above redirect does not work. Why is that? In Codeigniter, when you used redirect it works nomatter where it is called from.

If the above code sample is not the right way to do it, would appreciate if someone could show me how it is to be done. Thanks.

Edit
Report