improve exception message if symfony/security-csrf is missing
This commit is contained in:
parent
a5683c5324
commit
1a26ed43e7
@ -59,7 +59,7 @@ class FormRenderer implements FormRendererInterface
|
||||
public function renderCsrfToken($tokenId)
|
||||
{
|
||||
if (null === $this->csrfTokenManager) {
|
||||
throw new BadMethodCallException('CSRF tokens can only be generated if a CsrfTokenManagerInterface is injected in FormRenderer::__construct().');
|
||||
throw new BadMethodCallException('CSRF tokens can only be generated if a CsrfTokenManagerInterface is injected in FormRenderer::__construct(). Try running "composer require symfony/security-csrf".');
|
||||
}
|
||||
|
||||
return $this->csrfTokenManager->getToken($tokenId)->getValue();
|
||||
|
Reference in New Issue
Block a user