Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows set named views in ContentDecorator::$viewFile #19624

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions framework/widgets/ContentDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
* [[\yii\base\View]] component to make syntax more friendly. In the view these could be used as follows:
*
* ```php
* <?php $this->beginContent('@app/views/layouts/base.php') ?>
*
* some content here
*
* <?php $this->beginContent('main') ?>
* <aside id="sidebar-left">...</aside>
* <main id="main-content">
* <?= $content ?>
* </main>
* <?php $this->endContent() ?>
* ```
*
Expand Down Expand Up @@ -76,6 +77,6 @@
$params = $this->params;
$params['content'] = ob_get_clean();
// render under the existing context
echo $this->view->renderFile($this->viewFile, $params);
echo $this->view->render($this->viewFile, $params);

Check warning on line 80 in framework/widgets/ContentDecorator.php

View check run for this annotation

Codecov / codecov/patch

framework/widgets/ContentDecorator.php#L80

Added line #L80 was not covered by tests
}
}
Loading