我想动态更改控制器中的确认模板。我怎么能轻易做到?
这是我的配置:
fos_user:
[...]
registration:
form:
type: madden_user_registration
handler: madden_user.registration.form.handler
confirmation:
enabled: true
template: MaddenUserBundle:Registration:email_confirm.{locale}.html.twig
from_email:
address: %mailer_from%
sender_name: %mailer_registration_name%
在我的控制器中我有:
$confirmationEnabled = $this->container->getParameter('fos_user.registration.confirmation.enabled');
$formHandler = $this->get('fos_user.registration.form.handler');
$formHandler->process($confirmationEnabled);
有什么想法吗?谢谢!