Using the same controller method for form display and processing

code igniter
Print pagePDF pageEmail page

One of the common issues with MVC controller is to use the same controller method to show a form and then process it’s content, once we receive POST.

We detect whether there are any POST variables available with if ($this->input->post()). If available we process the form with POST data otherwise we show the form. You may have the form/file upload validation here.



Leave a Reply

Your email address will not be published. Required fields are marked *