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

Path fixed #5507

Closed
wants to merge 3 commits into from
Closed

Path fixed #5507

wants to merge 3 commits into from

Conversation

carlosreig
Copy link
Contributor

Path fixed since TwigBridge v2.7 changed the folder structure

Path fixed since to TwigBridge v2.7 changed the folder structure
@xabbuh
Copy link
Member

xabbuh commented Jul 9, 2015

Good catch @carlosreig. However, I think we should do better than hardcoding paths in the vendor directory.

What about using reflection here to determine the path to the TwigEngine class which reside in the top level directory of the TwigBridge?

@carlosreig
Copy link
Contributor Author

Cool! Good idea. I will work on it.

@carlosreig
Copy link
Contributor Author

Changed the hardcoded path by a ReflectionClass of the AppVariable class located in the TwigBridge library.
Used AppVariable instead of TwigEngine because TwigEngine has dependencies on the Templating component that is not needed if using the Form component outside Symfony framework.

@wouterj
Copy link
Member

wouterj commented Aug 29, 2015

👍

// form_div_layout.html.twig file
$vendorTwigBridgeDir =
$vendorDir.'/symfony/twig-bridge/Symfony/Bridge/Twig';
$appVariableReflection = new \ReflectionClass( '\Symfony\Bridge\Twig\AppVariable' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the spaces around the argument?

@carlosreig
Copy link
Contributor Author

Done! The spaces around the parameter are removed.

@wouterj
Copy link
Member

wouterj commented Sep 5, 2015

Thank you Carlos! This is a very flexible solution to fix the hardcoded path :)

wouterj added a commit that referenced this pull request Sep 5, 2015
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #5507).

Discussion
----------

Path fixed

Path fixed since TwigBridge v2.7 changed the folder structure

Commits
-------

8d7b5db Path fixed
@wouterj wouterj closed this Sep 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants