3
你能幫我解決這個問題嗎? 。我想上傳的標誌,當我輸入任何命令我3.2.8框架下無法識別的選項「資產」,symfony 3
無法識別的選項「資產」,「框架」
@Route("/admin/logo", name="logoCreatePage")
public function logoCreateAction(Request $request) {
$logos = new Logorama();
if($request -> isMethod('POST')) {
$image = $request -> files -> get('logourl');
if(($image instanceof UploadedFile) && ($image -> getError() == '0')) {
if(! ($image -> getSize() < 5000000)) {
$name_array = explode('.', $image -> getClientOriginalName());
$fileType = $name_array[sizeof($name_array) - 1];
$validFiletypes = array('jpg', 'jpeg', 'bmp', 'png');
if (in_array(strtolower($fileType), $validFiletypes)) {
$logoramarandom = rand(1000,10000);
$logoName = $logoramarandom . '.' . $name_array[1];
$image -> move(
$this -> getParameter('logo_directory'),$logoName
);
$logos -> setLogourl($logoName);
}
}
$em = $this -> getDoctrine() -> getManager();
$em -> persist($logos);
$em -> flush();
return $this -> redirectToRoute('indexPage');
}
}
return $this -> render('admin/logo.html.twig', array(
));
}
資產是您可以在配置中使用的實際選項嗎?我認爲這應該不是你在這裏的代碼。 – gwar9
只發生在命令上? ..給我'app/console --version'的輸出 – rafrsr
[同樣的問題](https://i.hizliresim.com/EgkO2Z.jpg) –