protected function attached($form)
{
if ($form instanceof Nette\Forms\Form) {
if (!$form->isMethod('post')) {
throw new Nette\InvalidStateException('File upload requires method POST.');
}
$form->getElementPrototype()->enctype = 'multipart/form-data';
}
parent::attached($form);
}
protected function attached($form) { parent::attached($form); $this->fileEntity = Objects::hasProperty($this->parent->data, $this->name) ? Objects::getProperty($this->parent->data, $this->name) : NULL; if ($this->fileEntity instanceof \Doctrine\Common\Collections\Collection) { $this->multi = true; } }