2010-11-01 204 views
0

使用的Recaptcha表單元素得到了我的形式出現以下錯誤:與Zend框架

Message: Invalid validator provided to addValidator; must be string or Zend_Validate_Interface 

我的驗證碼形式元素看起來是這樣的:

// set service 
    $recaptcha_service = new Zend_Service_ReCaptcha(Zend_Registry::get('pubKey'), Zend_Registry::get('privKey')); 
    // set adapter 
    $recaptcha_adapter = new Zend_Captcha_ReCaptcha(); 
    $recaptcha_adapter->setService($recaptcha_service); 
    // set element 
    $recaptcha = new Zend_Form_Element_Captcha('recaptcha'); 
    $recaptcha->setLabel('lskdjf') 
     ->setCaptcha($recaptcha_adapter); 

感謝您的幫助。

回答