I am new into the Zend framework, and I have a basic question.
Assume I am working with the layout.phtml or with the index.phtml of any script.
When I am using "$this->" to what instance am I referring to?
I read in a book the following: "$this is available within the template file, and it is the gateway to Zend_View’s functionality".
Does it mean that I can access any method, of any class that lies in any file inside the library/Zend/View/Helpers directory?
Excuse me if this question is silly and/or simple enough.
Thank you
$this->
In a view template is a reference to the Zend_view object you create in your controller.
Try var_dump($this)
or print_r($this)
(echo out a <pre>
before the print_r for nicer formatting) in the template. Var dump might help you figure out what is going on a little better.
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