equal
deleted
inserted
replaced
13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_View |
16 * @package Zend_View |
17 * @subpackage Helper |
17 * @subpackage Helper |
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @version $Id: PartialLoop.php 20096 2010-01-06 02:05:09Z bkarwin $ |
19 * @version $Id: PartialLoop.php 25203 2013-01-10 11:02:17Z frosch $ |
20 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @license http://framework.zend.com/license/new-bsd New BSD License |
21 */ |
21 */ |
22 |
22 |
23 /** Zend_View_Helper_Partial */ |
23 /** Zend_View_Helper_Partial */ |
24 require_once 'Zend/View/Helper/Partial.php'; |
24 require_once 'Zend/View/Helper/Partial.php'; |
27 * Helper for rendering a template fragment in its own variable scope; iterates |
27 * Helper for rendering a template fragment in its own variable scope; iterates |
28 * over data provided and renders for each iteration. |
28 * over data provided and renders for each iteration. |
29 * |
29 * |
30 * @package Zend_View |
30 * @package Zend_View |
31 * @subpackage Helper |
31 * @subpackage Helper |
32 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
32 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
33 * @license http://framework.zend.com/license/new-bsd New BSD License |
33 * @license http://framework.zend.com/license/new-bsd New BSD License |
34 */ |
34 */ |
35 class Zend_View_Helper_PartialLoop extends Zend_View_Helper_Partial |
35 class Zend_View_Helper_PartialLoop extends Zend_View_Helper_Partial |
36 { |
36 { |
37 |
37 |
83 $model = $model->toArray(); |
83 $model = $model->toArray(); |
84 } |
84 } |
85 |
85 |
86 $content = ''; |
86 $content = ''; |
87 // reset the counter if it's call again |
87 // reset the counter if it's call again |
88 $this->partialCounter = 0; |
88 $this->partialCounter = 0; |
|
89 $this->partialTotalCount = count($model); |
|
90 |
89 foreach ($model as $item) { |
91 foreach ($model as $item) { |
90 // increment the counter variable |
92 // increment the counter variable |
91 $this->partialCounter++; |
93 $this->partialCounter++; |
92 |
94 |
93 $content .= $this->partial($name, $module, $item); |
95 $content .= $this->partial($name, $module, $item); |