simple login form using symfony(使用 symfony 的简单登录表单)
问题描述
这是我的控制器
这是我的 security.yml
This is my security.yml
这是我的看法
我得到了这个错误.
Controller "AppBundleControllerSecurityController::loginAction()" 要求您为 "$authUtils" 参数提供一个值.参数可以为空且未提供空值、未提供默认值或因为在此参数之后有一个非可选参数.
Controller "AppBundleControllerSecurityController::loginAction()" requires that you provide a value for the "$authUtils" argument. Either the argument is nullable and no null value has been provided, no default value has been provided or because there is a non optional argument after this one.
推荐答案
这不是您问题的正确答案,而是一个可能的解决方案
This is not the correct answer to your question but a possible fix
- 将方法签名改为
public function loginAction(Request $request)
- 在您的操作开始处添加
$authUtils = $this->get('security.authentication_utils');
这篇关于使用 symfony 的简单登录表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!