Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit ce48ee0

Browse files
committed
Merge branch 'feature/1' into develop
Close #1
2 parents f13b7b3 + 4e30c39 commit ce48ee0

9 files changed

+498
-128
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ All notable changes to this project will be documented in this file, in reverse
66

77
### Added
88

9-
- Nothing.
9+
- [#1](https://github.com/zendframework/zend-view/pull/1) adds a new `loop()`
10+
method to the `partialLoop()` helper, allowing the ability to chain setters
11+
with rendering:
12+
`$this->partialLoop()->setObjectKey('foo')->loop('partial', $data)`
1013

1114
### Deprecated
1215

src/Helper/PartialLoop.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,20 @@ public function __invoke($name = null, $values = null)
5858
if (0 == func_num_args()) {
5959
return $this;
6060
}
61+
return $this->loop($name, $values);
62+
}
6163

64+
/**
65+
* Renders a template fragment within a variable scope distinct from the
66+
* calling View object.
67+
*
68+
* @param string $name Name of view script
69+
* @param array $values Variables to populate in the view
70+
* @throws Exception\InvalidArgumentException
71+
* @return string
72+
*/
73+
public function loop($name = null, $values = null)
74+
{
6275
// reset the counter if it's called again
6376
$this->partialCounter = 0;
6477
$content = '';

0 commit comments

Comments
 (0)