V
V
Vyacheslav_Shilov2020-08-02 13:42:02
Yii
Vyacheslav_Shilov, 2020-08-02 13:42:02

How to pass an array to a view in Yii1.1?

How to pass an array to a view? I didn't find it in the documentation. This is how it doesn't work:

public function actionAdd($id)
{
        $a = array(1,1);
        $this->render('add', array(
              'a'=>$a
));
    }

This also doesn't work:
$this->render('add', $a);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question