Home >php教程 >PHP开发 >Things to note when introducing external verification codes into the CI framework

Things to note when introducing external verification codes into the CI framework

黄舟
黄舟Original
2016-12-29 09:52:201250browse

When introducing an external verification code class, you need to make modifications in the imported external verification code class file.

Modify as follows:

public function __construct($arr = array()) {

    $width = '';
    $height = '';
    $codeLen = '';
    $fontSize = '';
    $bgColor = '';
    $fontColor = '';    if(!empty($arr)){
       extract($arr); 
    } 
    $this->font = BASEPATH . "fonts/font.ttf";       
    if (!is_file($this->font)) {
        error("验证码字体文件不存在");
    }
    $this->width = empty($width) ? $this->width : $width;
    $this->height = empty($height) ? $this->height : $height;
    $this->bgColor = empty($bgColor) ? $this->bgColor : $bgColor;
    $this->codeLen = empty($codeLen) ? $this->codeLen : $codeLen;
    $this->fontSize = empty($fontSize) ? $this->fontSize : $fontSize;
    $this->fontColor = empty($fontColor) ? $this->fontColor : $fontColor;
    $this->create();//生成验证码
}

The above is the content of the precautions for introducing external verification codes in the CI framework. For more related content, please pay attention to the PHP Chinese website (www.php.cn) !


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn