What will be the zend form decorator for the following code?
What should be the decorator to place these two elements side by side. Normally it's rendering the default zend's "dl-dt-dd" structure. I need both of these elements in a same dd with a common single label in the dt.
$card_expmonth = new Zend_Dojo_Form_Element_FilteringSelect('card_expmonth');
$card_expmonth->setLabel('Card Expiration')
->setMultiOptions(array(1=>'1','2','3','4','5','6','7','8','9','10','11','12'))
->setAttrib('style','width:100px;')
->setRequired(true);
$card_expyear = new Zend_Dojo_Form_Element_FilteringSelect('card_expyear');
$card_expyear->setMultiOptions(array(2011=>'2011','2012','2013','2014','2015','2016','2017','2018','2019','2020','2021','2022','2023','2024','开发者_JS百科2025'))
->setAttrib('style','width:100px;')
->setRequired(true);
Please someone help me.
$card_expmonth->setDecorators(array(
'ViewHelper',
array(array('dd' => 'HtmlTag'), array('tag' => 'dd', 'openOnly' => true)),
array('Label', array('tag' => 'dt')),
array(array('dl' => 'HtmlTag'), array('tag' => 'dl', 'openOnly' => true))
));
$card_expyear->setDecorators(array(
'ViewHelper',
array(array('dd' => 'HtmlTag'), array('tag' => 'dd', 'closeOnly' => true)),
array(array('dl' => 'HtmlTag'), array('tag' => 'dl', 'closeOnly' => true))
));
Not tested. Tell me if it doesn't work.
Read also http://devzone.zend.com/article/3450
精彩评论