用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1978|回复: 1
收起左侧

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

[复制链接]
发表于 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'];

本版积分规则