Answer the question
In order to leave comments, you need to log in
How to pass variable from Controller to views of TWIG widget?
Hello to all.
Yii, and especially twig, I know very superficially, that's why I ask for your help.
How is it possible, if at all, to pass a variable declared in protected\controllers\ProjectsController.php to pass it to the protected\views\widgets\catalog.twig template
. I have a variable - $new and ProjectsController.php is declared and it would need to be output to the catalog widget template. twig
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Just like without Twig:
$this->render('viewName', array(
'new' => $new,
));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question