私はViewScriptsを使用してフォーム要素を装飾しています。ラジオ要素では、通常、セパレータをオーバーライドできますが、ViewScriptを使用すると、オーバーライドは無視されます。
以下の呼び出しとViewScriptを使用すると、無線要素は、指定したスペースではなく、「<br/>」で区切られます。デフォルトのデコレータのままにすると、オーバーライドが機能します。
$this->addElement('radio', 'active', array(
'disableLoadDefaultDecorators' => true,
'decorators' => array(array('ViewScript', array('viewScript' => 'form/multi.phtml'))),
'label' => 'Active',
'required' => true,
'multiOptions' => array('1' => 'Yes', '0' => 'No',),
'value' => '1',
'separator' => ' ',
'filters' => array(),
'validators' => array(),
));
ViewScript:
<div class="field <?php echo strtolower(end(explode('_',$this->element->getType()))) ?><?php if($this->element->hasErrors()): ?> errors<?php endif; ?>" id="field_<?php echo $this->element->getId(); ?>">
<?php if (0 < strlen($this->element->getLabel())): ?>
<?php echo $this->formLabel($this->element->getName(), $this->element->getLabel());?>
<?php endif; ?>
<span class="value"><?php echo $this->{$this->element->helper}(
$this->element->getName(),
$this->element->getValue(),
$this->element->getAttribs(),
$this->element->getMultiOptions()
); ?></span>
<?php if ($this->element->hasErrors()): ?>
<?php echo $this->formErrors($this->element->getMessages()); ?>
<?php endif; ?>
<?php if (0 < strlen($this->element->getDescription())): ?>
<span class="hint"><?php echo $this->element->getDescription(); ?></span>
<?php endif; ?>
</div>