Partials are handy because they allow you to dissect html code and template logic into smaller reusable bits. PartialLoops allow you to loop through objects and arrays in an efficient manner and in a seperate variable scope.
Sometimes it is neccessary to access variables and their values from the view object's scope that the partial was called from.
This can be done quite easily from the by calling the partialLoop() or partial() (or another view helper's) method from the partial template and then accessing the view object from that.
You can use Zend_db_profiler to capture and examine the sql queries or statements that Zend db adapter forms and executes. example:
To get the request parameters in a Zend framework controller action you can use:
To register frontController plugins in the ZF (1.8 and higher) application.ini file you can use the following syntax:
To be able to set application wide constants inside the application ini file you can define a function as follows in the bootstrap class:
To change from the default view script (based on the action's name) and dynamically pick another view script to render you can use the following code:
Just add the following to layout.phtml (or the file of your layout template is in)
The default response segment your controllers action are outputting to is 'content'.
To change/set what response segment is written to inside your controller actions you can use the setResponseSegment method of the viewrenderer helper: