Answer the question
In order to leave comments, you need to log in
Creating a block site and passing a variable to layout?
I ask for help in what, in my index.php one view is rendered and it works like normal. rendered in content/
<?php $this->renderPartial('_topicday', array('topicday' => $topicday)); ?>
Now we need to make a new layout and drive this block into haeder where the logo is. One of the ideas is to insert this block into the layout, but here's the problem - an error is thrown - "undefined variable topicday "/ How to solve this problem, can anyone advise. I understand the question is amateurish but I'm not catching up on how to do it. Either the first option or the second.
and also the second question:
I want to make a site with 3 columns, but I want columns 1 and 3 not to change. Who will advise? There is an option to make panels, but there is a portlet. Looking for advice, thanks in advance.
Answer the question
In order to leave comments, you need to log in
Here are a couple of ways:
// В контроллере
public $topicday = "defaultvalue";;
public function actionTest() {
$this->topicday = "somevalue";
// ...
}
// Вывод в представлении (layout)
<?= $this->topicday ?>
$topicday
may not be defined in them. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question