[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.