I am starting in zend framework 1.11. How do we pass different $data value in view from controller to view like in codeigniter we pass like this.
$data['pass_one_thing'] = $this->model1->pass_all_mangoes();
$data['pass_another_thing'] = $this->model2->pass_all_oranges();
$this->load->view('viewfile', $data);
then in views we get values of $pass_one_thing and $pass_another_thing with foreach loops in same view file.
how do i pass from different model function in a same view ?
How do we get such thing in zend ? I am new to zend and bit confused.
You set it in your controller as:
$this->view->myVar = "something";
And then access it from the view:
echo $this->myVar;
Or using assign like Wesley said.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With