0

我有一个扩展 Twitter_Form 的表单(一个 Twitter 引导 css 表单),它又扩展了 Zend_Form。我想在 Zend_Form 中添加 ZendX_JQuery 元素,但由于装饰器而出现错误

错误是

Cannot render jQuery form element without at least one decorator implementing the 'ZendX_JQuery_Form_Decorator_UiWidgetElementMarker'
 Default decorator for this marker interface is the 'ZendX_JQuery_Form_Decorator_UiWidgetElement'. Hint: The ViewHelper decorator does not render jQuery elements 

表单类是:

class Application_Form_Classes extends Twitter_Form {

   $autocomplete = new ZendX_JQuery_Form_Element_Autocomplete('demo-input-local');
   $autocomplete->setJQueryParam('url','http://.../something.php');

   $this->addElement($autocomplete);


   $this->addElement("submit", "register", array("label" => "Register"));}
4

1 回答 1

0

我将自定义的 multipleautocomplete viewhelper 添加到我Twitter_Form的子表单中。如果有任何替代方法,请发布答案。

class Application_Form_Classes extends Twitter_Form{

   public function init(){

       $jqueryform = new ZendX_JQuery_Form();

       $multiautocomplete = new ZendX_JQuery_Form_Element_Multiautocomplete('demoinputlocal');
       $multiautocomplete->setJQueryParam('url','http://..../something.php');

        $jqueryform->addElement($multiautocomplete);

        $this->addSubForm($jqueryform, "jqueryform");

       $this->addElement("submit", "register", array("label" => "Register"));
       $this->addElement("reset", "reset", array("label" => "Reset"));

    }
}
于 2012-09-28T02:59:30.133 回答