0

I'm rendering another view in my view.

use yii\base\View;
    echo $this->render('current-view',array('test'=>'teeest'));

Now in other view - current-view.php I want to get access to this parametres:

use yii\base\View;
var_dump($params);
var_dump(Yii::$app->view->params); 

$params returns Null and $app->view->params returns empty array. As I understand from here proper solution is second one, but why array is empty then? What I missing?

Community
  • 1
  • 1
Sergey Scopin
  • 2,217
  • 9
  • 39
  • 67

1 Answers1

1

For see th content of you var you should use

var_dump($test);

you have passed 'test' in you render and then in view you should have $test

GAMITG
  • 3,810
  • 7
  • 32
  • 51
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107