You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if I have missed it in the documentation, but I couldn't find a simple method to provide a one line value from one template to another.
For example:
main template:
First of all, you are probably right about supply not being a good name.
Problem is that I wanted to port the Lavarel Blade yield feature.
Problem is that yield can't be used because is a PHP reserved keyword, so I opted for supply, you know, I am not a native English speaker and probably that was not a good synonymous...
However, changing name of templates method is something I really want to avoid.
If someone had already used Foil (I swear I had), a change like this means change any template ever wrote in any project.
Considering that one may have quite a lot templates (and layouts, and partials...) on every project, upgrading to the version introduce this change in all projects would mean change hundreds of template files, and in each file possibly multiple instances of supply... Sorry, but no.
Moreover, layout and templates should not work like that.
A layout is intended to be... a layout, i.e. defines sections of the page to be filled.
A line of text is more a variable than a section. So it's best served via render() method, or (that's possibly the solution you're looking for) via layout data:
Not sure if I have missed it in the documentation, but I couldn't find a simple method to provide a one line value from one template to another.
For example:
main template:
secondary template:
I think there should be a simple one line method to send a value to a supply. I would suggest doing something like this:
With this changes the templates would be:
main template:
secondary template:
I understand this could break backwards compatibility but I think moving forward might be a better naming for both methods.
Regards,
Adrian
The text was updated successfully, but these errors were encountered: