Skip to content

Commit

Permalink
[BUGFIX] Fix contentAs feature when used on Layout level
Browse files Browse the repository at this point in the history
`<f:render section="MySection" contentAs="content">some content</f:section>` does not work when called from a Layout because the `content` variable is not passed to the section in that case.
  • Loading branch information
smichaelsen authored Jul 31, 2019
1 parent 2d2d5db commit a1631a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/View/AbstractTemplateView.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ public function renderSection($sectionName, array $variables = [], $ignoreUnknow
if ($this->getCurrentRenderingType() === self::RENDERING_LAYOUT) {
// in case we render a layout right now, we will render a section inside a TEMPLATE.
$renderingTypeOnNextLevel = self::RENDERING_TEMPLATE;
foreach ($variables as $key => $value) {
$renderingContext->getVariableProvider()->add($key, $value);
}
} else {
$renderingContext = clone $renderingContext;
$renderingContext->setVariableProvider($renderingContext->getVariableProvider()->getScopeCopy($variables));
Expand Down

0 comments on commit a1631a9

Please sign in to comment.