CCaptcha zeigt kein Bild an yii
Ich habe ein Benutzerregistrierungsformular, in dem ich versuche, ein Captcha-Bild mithilfe des Yii-Widgets CCaptcha anzuzeigen. Mein Bildlink ist jedoch fehlerhaft. Controller-Datei:
public function actions()
{
return array(
// captcha action renders the CAPTCHA image displayed on the contact page
'captcha'=>array(
'class'=>'CCaptchaAction',
'backColor'=>0xFFFFFF,
),
);
}
Modelldatei:
public function rules()
{
return array( array('verifyCode','captcha','allowEmpty'=>!CCaptcha::checkRequirements(),'on'=>'insert'),
);
}
Und Datei anzeigen:
<?php if(CCaptcha::checkRequirements()): ?>
<div class="row">
<?php echo $form->labelEx($model,'verifyCode'); ?>
<div>
<?php $this->widget('CCaptcha'); ?>
<?php echo $form->textField($model,'verifyCode'); ?>
</div>
<div class="hint">Please enter the letters as shown.
<br/>Letters are not case-sensitive.</div>
<?php echo $form->error($model,'verifyCode'); ?>
</div>
<?php endif; ?>
Als Antwort habe ich irgendwo versucht, die Zugriffsregeln in meiner Controller-Datei als anzugeben
public function accessRules()
{
return array(
array('allow',
'actions' => array('captcha'),
'users' => array('*'),
),
);
}
Aber nichts scheint zu funktionieren.