我在Captcha验证的视图页面上有一个代码。这里没有显示图像。我还尝试对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,
),
);
}
这只是我的观点。没有显示图像
答案 0 :(得分:0)
谢谢@gultomicro
public function accessRules(){'actions'=>array('create','captcha'), 'users'=>array('*')}
您的回答