Welcome Guest, Not a member yet? Register   Sign In
Form flow
#1

[eluser]OllieBR[/eluser]
Hi guys, i´m new to CI my question is that if is right to make (whitout form validation class) a form using the same function that send you the view with the form as the function that receives the $_POST, something like this
Code:
function insert()
    {            
        if($_POST){
            echo 'do something with the data, like sending to a model function';
        }else{
            $this->load->helper(array('form', 'url'));
            
            //get data to populate the form with select options
            $data['countries'] = $this->mdTest->get_all_countries();        
            
            $this->load->view('Test/viewInsert',$data);
        }
    }
I came to this because I don´t want to create a new function only to receive the data from the form.

tnx


Messages In This Thread
Form flow - by El Forum - 07-23-2009, 12:47 PM
Form flow - by El Forum - 07-23-2009, 01:27 PM
Form flow - by El Forum - 07-23-2009, 03:17 PM
Form flow - by El Forum - 07-23-2009, 03:37 PM
Form flow - by El Forum - 07-23-2009, 03:40 PM
Form flow - by El Forum - 08-10-2009, 03:12 PM
Form flow - by El Forum - 08-10-2009, 03:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB