Answer the question
In order to leave comments, you need to log in
(Yii2) How to include View file?
How to include View files?
If you call the render function, then the variables are not saved.
// В данном случае $model не будет доступна для right_block.
<?php $this->render('blocks/right_block'); ?>
Answer the question
In order to leave comments, you need to log in
Can't you just pass it on?
<?php $this->render('blocks/right_block',['models' => $models]); ?>
Rendering in controllers https://github.com/yiisoft/yii2/blob/master/docs/g...
Rendering in widgets https://github.com/yiisoft/yii2/blob/master/docs/g...
Rendering in views https://github.com/yiisoft/yii2/blob/master/docs/g...
Rendering elsewhere https://github.com/yiisoft/yii2/blob/master/docs/g.. .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question