ZendX JQuery Dekoratör

0 Cevap php

Nasıl jQuery Element kısmi dekoratör kullanmak

Ben Form Elemanı için bu kodu kullanabilirsiniz:

    $title = new Zend_Form_Element_Text('title');
    $title->setRequired(true)
            ->setAttrib('class', 'inputbox')
            ->setLabel('Title');
    $title->viewScript = 'RegElement.phtml';
    $title->setDecorators(
            array(
                array('ViewScript', array('class' => 'RegElement'))
            )
    );

I Jquery Eleman kullandığınızda Ama ben bunu uygulamak nasıl bilmiyorum:

    $datePicker = new ZendX_JQuery_Form_Element_DatePicker(
                    "datePicker1", array("label" => "Date:")
    );
    $datePicker->viewScript = 'RegElement.phtml';
    $datePicker->setDecorators(
            array(
                array('ViewScript', array('class' => 'RegElement'))
            )
    );

    //views/scripts/RegElement.phtml
    <li class="row <?php echo $this->class ?>">
        <div class="cont-error">
         <?php echo $this->formErrors($this->element->getMessages()); ?>
        </div>
        <div class="rowfields">
           <?php echo $this->formLabel($this->element->getName(),
                      $this->element->getLabel()) ?>
        <?php
            echo $this->{$this->element->helper}(
                 $this->element->getName(),
                 $this->element->getValue(),
                 $this->element->getAttribs()
             )
         ?>
        </div>
        <div class="hint"><?php echo $this->element->getDescription() ?></div>
    </li>

Ve bu hatayı görüntüler:

Warning: Exception caught by form: Cannot render jQuery form element without at least one decorator implementing the 'ZendX_JQuery_Form_Decorator_UiWidgetElementMarker' interface.

I need display datePicker with same format. but I dont know how implement this interface. thanks for your help.

0 Cevap