php - 更改 Zend 图片验证码样式

标签 php zend-framework zend-form captcha

我有一个 Zend 格式的图片验证码

$captcha = new Zend_Form_Element_Captcha('captcha', array('captcha' => array(
    'captcha'   => 'Image',
    'label'     => 'Rasmdagi belgilarni kiriting',
    'required'  => true,
    'wordLen'   => 5,
    'width'     => 150,
    'height'    => 40,
    'timeout'   => 300,
    'fontSize'  => 32,
    'gcFreq'    => 5,
    'font'      => 'files/captcha/fonts/4.ttf',
    'imgDir'    => 'files/captcha/image',
    'imgUrl'    => '/files/captcha/image',
)));
$captcha->setIgnore(true);

我必须改变它的风格(背景)。

最佳答案

我相信你不能改变验证码图像的背景。它被硬编码到 Zend_Captcha_Image 中。您必须创建自己的验证码图像类,例如My_Captcha_Image 通过扩展 Zend_Captcha_Image 并修改图像设置背景的行。

关于php - 更改 Zend 图片验证码样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5907245/

相关文章:

php - 如何在 Zend Form 中添加验证码?

php - 跨页面混合 PHP 和 CSS

php - 如何从同一个表中选择不同的总和值

php - 输出自定义错误消息而不是默认的 php 错误消息

php - Zend Framework findBy 魔术方法?

php - Zend Framework : Using Models and Views, 最佳实践

zend-framework - zendframework 2 - 保存自定义库文件夹的位置

php - zend,如何添加带有数字和文本的multiOption?

php - Laravel 迁移 : unique key is too long, 即使指定

javascript - 是否可以在 Zend 表单中显示和隐藏子表单 onclick