Mam kod formularza:
[...]
'destination' => APPLICATION_PATH.'/../public/upload',
array('count', false, 1
), array('size', false, 102400), ),
'label' => 'Wyślij plik:'
)),
'destination' => APPLICATION_PATH.'/../public/upload',
array('count', false, 1
), array('size', false, 102400), ),
'label' => 'Wyślij plik:'
)),
'destination' => APPLICATION_PATH.'/../public/upload',
array('count', false, 1
), array('size', false, 102400), ),
'label' => 'Wyślij plik:'
)),
'destination' => APPLICATION_PATH.'/../public/upload',
array('count', false, 1
), array('size', false, 102400), ),
'label' => 'Wyślij plik:'
)),
));
Do tego dodany dekorator:
$this->setDecorators(array( 'class' => 'form'
)),
'class' => 'form'
))
));
$this
->setElementDecorators(array( 'class' => 'input'
)),
'Label',
'tag' => 'div',
'class' => 'description',
'escape' => false,
'placement'=> 'append'
)),
'tag' => 'div',
'class' => 'error'
)),
'tag' => 'div',
'class' => 'element'
)),
'tag' => 'div',
'class' => 'element'
))
));
Bez dekoratora
file dostaję error o braku dekoratora - nie wiem czemu pierwszy raz słyszę o tym dekoratorze, ale jeśli go dodaję to form wygląda tak:
<div class="element">
<label class="optional" for="file1">Wyślij plik:</label>
<input id="file1" type="file" name="file1">
</div>
<input id="MAX_FILE_SIZE" type="hidden" value="104857600" name="MAX_FILE_SIZE">
<input id="file1" class="element" type="file" tag="div" name="file1">
<span
class="subtip">Max
. file size
30720 Kb
.</span
> <p></p>
A wszystkie inne elementy mają error:
Warning: Method getMaxFileSize does not exist in H:\panel\library\Zend\Form\Element.php on line 2061
Więc nie dość że form pokazuje się dwa razy to jeszcze psuje resztę formularza... Jest jakieś inne rozwiązanie niż przeliterowanie całego forma i dodanie mu dekoratora w zależności od typu pola? (input,select,checkbox lub file)