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

Merge Twig global scope with Laravel Globals #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

astoltz
Copy link
Contributor

@astoltz astoltz commented Jul 5, 2015

When you import a template that contains macros, then call one of those macros, they do not have access to the Laravel view globals such as "errors". This patch fixes that.

The code is duplicate of that from Bridge::mergeShared(). The logic in mergeShared might be able to be removed.

@barryvdh
Copy link
Collaborator

barryvdh commented Jul 7, 2015

What's the difference between globals an shared?

@astoltz
Copy link
Contributor Author

astoltz commented Mar 16, 2019

What's the difference between globals an shared?

Shared is the context of the template that is directly being rendered. Global is available to all templates. As an example, Laravel pushes form validation messages to a global called "errors". This is accessible to the main template. However, without this PR, you cannot access "errors" from a macro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants