Welcome Guest, Not a member yet? Register   Sign In
How to send the values of variable from controllers to models ?
#1

[eluser]dimasVS[/eluser]
Hi all,,
I need your help..
how to send the value of variable that created from controller to be sent to models ???

this is my script in Controllers :

function do_upload(){
$n = rand(0,100000);
$nama_file = $_FILES['userfile']['name'];
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$config['encrypt_name'] = "$n";
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());

$this->load->view('admin/employeeAdd', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
$image_data = $this->upload->data();
$file_name = $image_data['file_name'];
echo $file_name;
echo "Register Successfull<br />";
echo anchor('admin/employee', 'Back');
}
}

how to send the value of $file_name to Models ?
and how to catch that value in models ?

Thanks...


Messages In This Thread
How to send the values of variable from controllers to models ? - by El Forum - 02-15-2010, 07:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB