Skip to content

Commit 227322a

Browse files
committed
reset Twig form theme resources between requests
1 parent b256d44 commit 227322a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

AbstractRendererEngine.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212
namespace Symfony\Component\Form;
1313

14+
use Symfony\Contracts\Service\ResetInterface;
15+
1416
/**
1517
* Default implementation of {@link FormRendererEngineInterface}.
1618
*
1719
* @author Bernhard Schussek <[email protected]>
1820
*/
19-
abstract class AbstractRendererEngine implements FormRendererEngineInterface
21+
abstract class AbstractRendererEngine implements FormRendererEngineInterface, ResetInterface
2022
{
2123
/**
2224
* The variable in {@link FormView} used as cache key.
@@ -197,4 +199,12 @@ private function loadResourceForBlockNameHierarchy(string $cacheKey, FormView $v
197199

198200
return false;
199201
}
202+
203+
public function reset(): void
204+
{
205+
$this->themes = [];
206+
$this->useDefaultThemes = [];
207+
$this->resources = [];
208+
$this->resourceHierarchyLevels = [];
209+
}
200210
}

0 commit comments

Comments
 (0)