Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...

When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Creating and Rendering Composite Elements

In the last section, we had an example showing a "date of birth element":

<div class="element">
    <?php echo $form->dateOfBirth->renderLabel() ?>
    <?php echo $this->formText('dateOfBirth[day]''', array(
'size' => 2'maxlength' => 2)) ?>
    <?php echo $this->formText('dateOfBirth[month]''', array(
'size' => 2'maxlength' => 2)) ?>
    <?php echo $this->formText('dateOfBirth[year]''', array(
'size' => 4'maxlength' => 4)) ?>

How might you represent this element as a Zend_Form_Element? How might you write a decorator to render it?

Zend Framework