开发者

How to render label and element separately in a zend form using DOJO element

开发者 https://www.devze.com 2023-03-28 07:58 出处:网络
i\'ve created a standard zend form with some simple zend element and one DOJO date picker. $fromDate = new Zend_Dojo_Form_Element_DateTextBox(\'fromDate\');

i've created a standard zend form with some simple zend element and one DOJO date picker.

$fromDate = new Zend_Dojo_Form_Element_DateTextBox('fromDate');
$fromDate->setLabel('From Date')
            ->setDatePattern('dd-MM-yyyy');
$this->addElement($fromDate);

It works as expected. i can select the date from the associated dropdown. But is it possible to render t开发者_开发问答he label as well as the element separately?

On the ordinary zend elements i use the following in my view:

<?php echo $this->form->headline->renderViewHelper() ?>

to render the element and to render the label:

<?php echo $this->form->headline->renderLabel() ?>

(I'm not sure about the 'renderLabel' function' i can't find an example right now )

Is it possible to render the label and element separately on the DOJO element?


->renderLabel() works with both Zend_Form object or Zend_Dojo_Form

However, when you're using Zend_Dojo_Form, you must use ->renderDijitElement() instead of ->renderViewHelper().

0

精彩评论

暂无评论...
验证码 换一张
取 消