ZF-7151: Add totalCount to partialLoop view helper
Description
It would be useful to have access to the total count of the model within the partialLoop, as we do with the current position in the loop (partialCounter). This would allow you to do stuff like echo "item $this->partialCounter of $this->totalCount" as well as some HTML styling which requires a different class for the final
in an . To implement, add code like: Zend_View_Helper_Partial 74 if (isset($this->partialTotalCount)) { 75 $view->partialTotalCount= $this->partialTotalCount; 76 } Zend_View_Helper_PartiaLoop: 89 $this->partialCount = count($model);
Comments
Posted by Mark (lightflowmark) on 2009-07-27T09:49:37.000+0000
Patched as outlined, adding partialTotalCount property. Test attached also.
Posted by Frank Brückner (frosch) on 2013-01-10T11:02:48.000+0000
Fixed on trunk (25202) and release-1.12 (25203)
Thanks to Mark!