Welcome Guest, Not a member yet? Register   Sign In
How does Model and Controller Variable Passes
#1

[eluser]JingCleoVil[/eluser]
How does model variable model passes back to controller?

i.e.
--Controller--
Code:
<?php
class Main extends Controller()
{
    function Main()
    {
      parent::Controller()
    }
    function index()
    {
       $data['result'] = from model variable
       $this->load->view('main/index',$data);
    }
    function insert()
    {
       $this->load->model('member');
       $this->model->insert();
    }
}
?>

--Model--
Code:
<?php
class Member extends Model
{
     var $name = '';
     var $email = '';
    
     function Member()
     {
        parent::Model();    
     }
     function insert()
     {
        $this->name = $_POST['name'];
        $this->email = $_POST['email];
        $this->db->insert('member',$this);
        $variable = 'must be pass to the $data['result']
     }
}
?>

I would like to use Model as my alternative way of validation instead of form_validation( i knew how does this work.).

Thanks in advance.


Messages In This Thread
How does Model and Controller Variable Passes - by El Forum - 07-08-2009, 06:48 PM
How does Model and Controller Variable Passes - by El Forum - 07-08-2009, 07:09 PM
How does Model and Controller Variable Passes - by El Forum - 07-09-2009, 12:03 AM
How does Model and Controller Variable Passes - by El Forum - 07-09-2009, 12:39 AM
How does Model and Controller Variable Passes - by El Forum - 07-09-2009, 01:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB