Issues

ZF-7151: Add totalCount to partialLoop view helper

Issue Type: Improvement Created: 2009-06-28T07:29:11.000+0000 Last Updated: 2013-01-10T11:02:48.000+0000 Status: Resolved Fix version(s): - 1.12.2 (25/Feb/13)

Reporter: Mark (lightflowmark) Assignee: Mark (lightflowmark) Tags: - Zend_View

  • FixForZF1.12.1
  • zf-crteam-review

Related issues: Attachments: - ZF-7151_fix.patch

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!

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts