Passing Variables Issue


I’m trying to figure out why this variable isn’t passing through to my view file correctly.

Inside my controller action I have the following code:


. . .

$test = 5;

$this->render(‘update_tasklist2’,array(‘tasks’=>$tasks, ‘test’=>$test));[/indent]

$tasks is an array of models and passes through to the view file fine and is utilized properly, but I can’t seem to access $test from the view file.

When I do a simple:

[indent]echo $test; [/indent]

It prints nothing.

What am I doing wrong here?

everything seems right, Is it display any error ? Try to var_dump tthis value.

This happens if you’re trying to output variables not in “main” view file (update_tasklist2 in your case) but in partial views (using renderPartial).