From 089463e4cd489fc3d2a8352e40e7babd348f0dc7 Mon Sep 17 00:00:00 2001 From: Anton Date: Sat, 15 Oct 2022 09:18:14 +0300 Subject: [PATCH] Allows set named views in `ContentDecorator::$viewFile` --- framework/widgets/ContentDecorator.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/framework/widgets/ContentDecorator.php b/framework/widgets/ContentDecorator.php index 1b7d00781db..6f8192a355c 100644 --- a/framework/widgets/ContentDecorator.php +++ b/framework/widgets/ContentDecorator.php @@ -30,10 +30,11 @@ * [[\yii\base\View]] component to make syntax more friendly. In the view these could be used as follows: * * ```php - * beginContent('@app/views/layouts/base.php') ?> - * - * some content here - * + * beginContent('main') ?> + * + *
+ * + *
* endContent() ?> * ``` * @@ -76,6 +77,6 @@ public function run() $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); } }