Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
improve exception message if symfony/security-csrf is missing
  • Loading branch information
xabbuh committed Feb 26, 2021
commit 1a26ed43e7c9cf05bebcc6113bd41aba455a23e6
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/FormRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function setTheme(FormView $view, $themes, $useDefaultThemes = true)
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();
Expand Down