[英]Laravel form choosing form
I have problem with laravel form and choosing files 我在laravel表单和选择文件时遇到问题
$language = $request->input('language');
if($language = "eng"){
$type = "emails/eng";
} else if($language = "pl" ){
$type ="emails/pl";
}
dump($language);
dump($type);
when I do that in controller I always get the same result with "eng" but when I delete if rules I get "eng" and "pl". 当我在控制器中执行此操作时,我总是得到与“ eng”相同的结果,但是当规则删除时,我得到“ eng”和“ pl”。
Any help with that ? 有什么帮助吗?
You must use "==" to compare: 您必须使用“ ==”进行比较:
if($language == "eng"){
$type = "emails/eng";
} else if($language == "pl" ){
$type ="emails/pl";
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.