New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare plugins for Twig in template.xml #988

Closed
marcimat opened this Issue Aug 5, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@marcimat
Contributor

marcimat commented Aug 5, 2013

With 2.0.0, I'll try to add plugins to the Twig Environnement. In the template.xml I declare those lines :

<parameters>
     <twig-extension>\Twig_Extension_Debug</twig-extension>
     <twig-extension>\autodoc\Plugin\Core\TwigZora</twig-extension>
</parameters>

But, Twig doesn't recieve theses parameters.
I have no parameters in the method addExtensionsFromTemplateConfiguration() in https://github.com/phpDocumentor/phpDocumentor2/blob/develop/src/phpDocumentor/Plugin/Core/Transformer/Writer/Twig.php#L269

Thanks for all great work in this new version !

@mvriel

This comment has been minimized.

Member

mvriel commented Sep 2, 2013

I have been debugging this and it appears that the code to handle parameters could be improved and there seems to be an issue in JMS Serializer that prevents the parameters array from populating. I have created issue schmittjoh/serializer#139 to investigate this

@mvriel

This comment has been minimized.

Member

mvriel commented Sep 6, 2013

I have fixed this issue in the develop branch of phpDocumentor2. Unfortunately I had to change the format of the parameters due to a limitation in JMS Serializer.

You can add the following to your template:

  <parameters>
     <parameter key="twig-extension">\Twig_Extension_Debug</parameter>
  </parameters>

You can also set the parameter twig-debug to the value true; this will enable debug mode for Twig and include the debug extension

@mvriel mvriel closed this Sep 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment