Zend Framework Reference

Zend Framework Access view values from partialLoop

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.

Zend Framework Zend db examine SQL query

You can use Zend_db_profiler to capture and examine the sql queries or statements that Zend db adapter forms and executes. example:

Zend Framework Retrieve request params

To get the request parameters in a Zend framework controller action you can use:

Zend Framework Register plugins in ZF application.ini

To register frontController plugins in the ZF (1.8 and higher) application.ini file you can use the following syntax:

Zend Framework Set constants in ZF application ini file

To be able to set application wide constants inside the application ini file you can define a function as follows in the bootstrap class:

Zend Framework Change view script in ZF controller action

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:

Zend Framework Quick setup of navigation menu on every page

Just add the following to layout.phtml (or the file of your layout template is in)

Zend Framework Disable layout and viewRenderer in controller

To disable the layout and the viewrenderer on the fly inside a controller you can use the following lines :

Zend Framework Set response segment in controller actions

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:

[x]