1
Symfony2에서 여러 파일을 업로드하려고합니다. 나는 컨트롤러에서 처리하지 않고이 작업을 수행해야하고, 그 trought 라이프 사이클을 시도,하지만 난, 난 방법, 내가 수정할 필요가 있다고 생각 내 개체의 여러 인스턴스를 생성하지 못할 :Symfony2에 여러 파일 업로드
:/**
* Sets file.
*
* @param UploadedFile $photo
*/
public function setPhoto(UploadedFile $photo = null)
{
$this->photo = $photo;
if (isset($this->path)) {
$this->temp = $this->path;
$this->path = null;
} else {
$this->path = 'initial';
}
}
그런 일에
/**
* Sets file.
*
* @param ArrayCollection $photo
*/
public function setPhoto(ArrayCollection $photo = null)
{
foreach ($photo as $photos) {
$file = new UploadedFile();
$this->photo = $file;
}
}
초보자를 부탁드립니다.