Skip to content
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
Closed

Declare plugins for Twig in template.xml #988

marcimat opened this issue Aug 5, 2013 · 2 comments
Labels
bug

Comments

@marcimat
Copy link
Contributor

@marcimat 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
Copy link
Member

@mvriel 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
Copy link
Member

@mvriel 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants