Create @scope Blade directives which creates a variable scope like @include but does not require a file. #38844
Unanswered
christianmagill
asked this question in
Ideas
Replies: 1 comment
-
For reference: Other templating engines implemented it like this: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Often I find myself wanting to
extract()
the contents of an array for ease of coding, but I don't want the data polluting the global space.I'd love to see
@scope
and@endscope
directives added for times when scoping would be useful, but an@include
wouldn't make sense.Perhaps the first parameter takes an array of data to be extracted, and a second optional parameter would determine if the view's scope should be inherited or not.
So a simple example might look like
Beta Was this translation helpful? Give feedback.
All reactions