원하는 변수 만 함수로 보낼 수 있습니까? 난에 거짓 $ ENC =를 설정할 예컨대 이런 기능특정 변수를 함수에 전송
function upload_file($field = "thumbnail",$types = 'gif|jpg|jpeg|png|pdf',$folder = "",$size = '0',$w = '0',$h = '0', $enc = false)
{
if ($folder == "")
{
$config['upload_path'] = './Media/uploads/';
}
else
{
if (!is_dir("./Media/uploads/$folder/"))
{
mkdir("./Media/uploads/$folder/");
}
$config['upload_path'] = "./Media/uploads/$folder/";
}
$config['allowed_types'] = $types;
$config['max_size'] = $size;
$config['max_width'] = $w;
$config['max_height'] = $h;
$config['encrypt_name'] = $enc;
$this->load->library('upload', $config);
if (! $this->upload->do_upload($field))
{
$error = array('error' => $this->upload->display_errors());
print_r($error);
return array(false,$error);
}
else
{
$data = array('upload_data' => $this->upload->data());
return array(true,$data);
}
}
가 나는
function upload_file($field = "thumbnail",$types = 'gif|jpg|jpeg|png|pdf',$folder = "",$size = '0',$w = '0',$h = '0', $enc = false)
에 포함 된 설정 변수에서이
처럼 사용할 이
$data = $this->base_model->upload_file();
를 사용하여 $ ENC = 사실이 일어날 수 있도록하는 방법은 무엇입니까?
'$ enc = true'를 함수 프로파일에 넣지 않는 이유는 무엇입니까? 그런 식으로'$ this-> base_model-> upload_file();이 당신이 원하는 것을 제공 할 것입니다 ... – anthonygore