Yii Captcha图像未显示在窗体上

问题描述 投票:1回答:1

我在验证码验证的查看页面上有一个代码。 没有图像显示在这里。 我还尝试对CCaptcha进行需求检查,并将代码放在控制器上以进行操作重定向。 但是没有什么可以改善的。

我的观点

        <?php
        if(CCaptcha::checkRequirements()){
        $this->widget('CCaptcha'); ?>
        <?php echo $form->textField($model,'verifyCode'); ?>
        </div>
        <div class="hint">Please enter the letters as they are shown in the image above.
        <br/>Letters are not case-sensitive.</div>
        <?php echo $form->error($model,'verifyCode'); 

                }
         ?>

在我的控制器中

public function actions()
{
    return array(
        // captcha action renders the CAPTCHA image displayed on the contact page
        'captcha'=>array(
            'class'=>'CCaptchaAction',
            'backColor'=>0xFFFFFF,
        ),

    );
}

这只是我的看法。 没有图像显示

验证码

php yii captcha
1个回答
0
投票

谢谢@gultomicro

public function accessRules(){'actions'=>array('create','captcha'), 'users'=>array('*')}

给你答案

© www.soinside.com 2019 - 2024. All rights reserved.