I'm having some trouble shaping the form layout the way I want it to look. The problem here isn't decorating the file element itself, the trouble comes with the function: $file->setMultiFile(3)
. I can't seem to put a separator between multiple file input elements causing them to be placed in a row behind eachother.
This is how I create the file Element:
$oElement = new Zend_Form_Element_File('file');
$oElement->setLabel('File')
->setMultiFile(3)
->setDestination('location on server');
$this->addElement($oElement);
Then later I add the decorators:
$this->getElement('file')->setDecorators(array(
'File',
'Errors',
array(array('td' => 'HtmlTag'), array('tag' => 'td')),
array('Label', array('tag' => 'td')),
array(array('tr' => 'HtmlTag'), array('tag' => 'tr'))
));
The current output is:
<tr>
<td id="file-label">
<label class="optional" for="file">File</label>
</td>
<td>
<input type="file" id="file-0" name="file[]">
<input type="file" id="file-1" name="file[]">
<input type="file" id="file-2" name="file[]">
</td>
</tr>
What I want is to have a <br />
between the input elements so they're not placed on a single row. Is this possible through decorators? With the radio/mutliselect/multicheckbox there's a setSeparator
function that'll do this, but this doesn't seem to be the case for the file element.
Could anybody help me out here? Thanks in advance,
Ilian