panupat (1) [Avatar] Offline
#1
I just started learning Zend and am following examples in chapter 2. I have some problem getting arrays from controller to show up on my view.

I'm very confused right now and would appreciate any help.

this works

controller :
$this->view->a = 'text';

view :
echo $this->a;

Then I move on to try the $view thing

controller :
$view->a = "AAA";

and echo $this->a does nothing : / I tried adding
$view = new Zend_View();

$view->a = "AAA";

and it's still doing nothing. No error message tho.

And then I tried moving on to the array part
controller :
$test = array('a'=>'AAA', 'b'=>'BBB');

$test = array('a'=>'CCC', 'b'=>'DDD');

$this->view->assign($test);

and I can't out put that from my view at all. I can't even get it to detect whether the variable exists.
view :
if ($this->a) { echo something }

if ($this->view) { echo something }

I would greatly appreciate any help.
Thank you.
akrabat (479) [Avatar] Offline
#2
Re: chapter 2 - question outputting array
Have you gone through my tutorial at http://akrabat.com/zft ?

Regards,

Rob...