风快走了 发表于 2016-5-21 01:43:11

为什么不能加载铺助函数类,出现找不到方法

public function index(){
                /*
               * 载入验证码辅助函数
                */
                $this->load->helper('captcha');
                $vals = array(
            'word'      => 'Random word',
            'img_path'=> './captcha/',
            'img_url'   => 'http://example.com/captcha/',
            'font_path' => './path/to/fonts/texb.ttf',
            'img_width' => '150',
            'img_height'    => 30,
            'expiration'    => 7200,
            'word_length'   => 8,
            'font_size' => 16,
            'img_id'    => 'Imageid',
            'pool'      => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',

            // White background and border, black text and red grid
            'colors'    => array(
                'background' => array(255, 255, 255),
                'border' => array(255, 255, 255),
                'text' => array(0, 0, 0),
                'grid' => array(255, 40, 40)
            )
      );

      $cap = create_captcha($vals);


出现如下错误:

PHP Fatal error: Call to a member function helper() on a non-object in G:\IIS\CI\application\controllers\admin\login.php on line 9
      echo $cap['image'];

风快走了 发表于 2016-5-21 03:02:17

搞定了
页: [1]
查看完整版本: 为什么不能加载铺助函数类,出现找不到方法