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
The partial references a JS file (which should be appended to the "end-body" section of the layout) and some HTML which should be inserted whereever $this->insert('partial-name') is called.
Hi @janwalther thanks for your interest in Foil and the detailed issue.
And sorry for the trouble.
I think this is a regression bug that has been introduced with a section handling change I did in a previous release to fix a another bug. And it was not catched because missing test...
Can you please test if the bus is still there if you use stop() / replace() instead of append()?
An unrelated thing:
you could replace your:
<?php$this->section('content'); $this->stop(); ?>
with
<?php$this->supply('content') ?>
The reason to be of supply() is just that: render section content if it exists, or do nothing if not.
And also with $this->replace().
And in the end I would have to use append because there could be multiple partials which all want to append JS file embedding to "end-body" section.
Thanks for mentioning $this->supply(). I replaced all $this->section('name');$this->stop() with $this->supply('name'); but as said the JS files get included twice.
I have the following setup:
The layout defines sections:
Then there is the template appending some content to the content section of the layout. Some of the content is loaded by including a partial:
The partial references a JS file (which should be appended to the "end-body" section of the layout) and some HTML which should be inserted whereever $this->insert('partial-name') is called.
The result is:
So the JS files get embedded twice.
I am quite sure that I did something wrong but perhaps this really is a bug.
The text was updated successfully, but these errors were encountered: