You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the way Twig works, the initRuntime method is only called the first time we load a template. So when using the renderer from elsewhere than a Twig template, we need to initialize it manually (as documented)
Passing the environment to the TwigRenderer when creating it would be the solution but it is impossible currently as it would create a circular dependency. We would need to remove the need to have it as a Twig extension to do this.
https://github.com/fabpot/Twig/issues/429 would allow getting rid of this need if it is implemented. But it would mean than (the yet-to-be-released) Twig 1.2 (assuming it is added in 1.2) will become a requirement, which is an issue for Symfony2 until it becomes the release (not an issue for Silex as it already requires using the master branch)
The text was updated successfully, but these errors were encountered:
Currently when creating a RecursiveItemIterator passing a new ArrayIterator, the Iterator is indexed by int.
```php
$treeIterator = new \RecursiveIteratorIterator(
new RecursiveItemIterator(
new \ArrayIterator(array($menu))
), \RecursiveIteratorIterator::SELF_FIRST
);
```
So we got the following error:
Parameter KnpLabs#1 $iterator of class Knp\Menu\Iterator\RecursiveItemIterator constructor expects
Traversable<string, Knp\Menu\ItemInterface>, ArrayIterator<int, Knp\Menu\ItemInterface> given.
I can notice that the typehint in CurrentItemFilterIterator is ok:
https://github.com/KnpLabs/KnpMenu/blob/master/src/Knp/Menu/Iterator/CurrentItemFilterIterator.php
Due to the way Twig works, the initRuntime method is only called the first time we load a template. So when using the renderer from elsewhere than a Twig template, we need to initialize it manually (as documented)
Passing the environment to the TwigRenderer when creating it would be the solution but it is impossible currently as it would create a circular dependency. We would need to remove the need to have it as a Twig extension to do this.
https://github.com/fabpot/Twig/issues/429 would allow getting rid of this need if it is implemented. But it would mean than (the yet-to-be-released) Twig 1.2 (assuming it is added in 1.2) will become a requirement, which is an issue for Symfony2 until it becomes the release (not an issue for Silex as it already requires using the master branch)
The text was updated successfully, but these errors were encountered: