I'm new to zend and OOP in general. I have a indexAction with a variable that I need to pass to the view. I've declared the variable as public and I thought I could then get the variable in the view using $this->variable but it doesn't work.
How do I pass a variable from indexAction to the view?
Within indexAction, you need to assign it to the view instance. simply do:
$this->view->something = "foo";
and in your view:
<?php echo $this->something ?>
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