jeudi 23 août 2018

passing variable from controller to view page shows undefined variable in yii2

i'm very new to yii2 framework. i want to pass variable from controller to view.

in Controller

public function actionDeleteAll(){
    $var1 = 'abc';
    return $this->redirect(array('index', 'var_view' => $var1 ));
}

in View

   <?php  
    echo $_GET['var_view'];
?>

but page show enter image description here

thank you for your help.




Aucun commentaire:

Enregistrer un commentaire