37duc 发表于 2008-9-28 16:59:53

一个helper辅助函数怎么调用系统libraries 类库?

我有一个global_func_helper.php文件在helper文件夹里边。
   
global_func_helper.php有个函数需要调用系统图片处理的UPLOAD类,但是按照 $this->load->library('upload', $config);

的方法引用就出错。请问正确的写法应该是怎么样的?

以下为部分代码:

function upfile($filename=''){
      $config['max_width']= '1024';
      $config['max_height']= '768';
      $this->load->library('upload', $config);
   }

谢谢解答!~

Hex 发表于 2008-9-28 17:05:49

$CI =& get_instance();
$CI->load->library();

37duc 发表于 2008-9-28 17:14:23

效率好高啊,谢谢HEX
页: [1]
查看完整版本: 一个helper辅助函数怎么调用系统libraries 类库?