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) –