Answer the question
In order to leave comments, you need to log in
How to connect another template inside a template in Yii2?
How to connect another template inside a template in Yii2? Surely there is some kind of "directive" like include? Read the documentation. But didn't get in a bit. Essence: in a template to be used "subtemplate".
Answer the question
In order to leave comments, you need to log in
www.yiiframework.com/doc-2.0/guide-structure-views...
1. Sub-template can be rendered
$this->render('another_template',['prop'=>$val]);//шаблон в этой же директории
$this->renderFile('@app/some/path/views/another_template',['prop'=>$val]);//шаблон из другого места
<?php $this->beginContent('@app/views/layouts/base.php'); ?>
//Some another content - внедрение в вывод контента вызываемого layout
<?php $this->endContent(); ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question