Skip to content

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 astoltz force-pushed the feature/laravel-globals branch from 543b59d to 23ad786 Compare March 16, 2019 21:02
@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.

2 participants