Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

PartialLoop helper: prevent convert traversable model to array recursive... #4969

Merged
merged 2 commits into from Aug 19, 2013

Conversation

Projects
None yet
3 participants

tranba commented Aug 16, 2013

...ly

I consider when we pass a model as traversable to partial loop, we don't need to convert it to array recursively.
For example, when we pass a form collection (of fieldsets) to partial loop as the model, if we converted it to array recursively -> fieldsets will converted to array too, in view script we can't access the fieldset through object key.

Member

Ocramius commented Aug 16, 2013

@tranba misses related test

tranba commented Aug 17, 2013

Sorry, I want to delete some incorrect commit.

tranba commented Aug 19, 2013

@Ocramius review my test please

@Ocramius Ocramius commented on the diff Aug 19, 2013

...s/partialLoopShouldNotConvertToArrayRecursively.phtml
@@ -0,0 +1,5 @@
+<?php if (!isset($this->obj)): ?>
+No object model passed
+<?php else:
+ echo 'This is an iteration: ' . $this->obj->current() . "\n";
+endif;
@Ocramius

Ocramius Aug 19, 2013

Member

EOF EOL needed

@Ocramius Ocramius commented on an outdated diff Aug 19, 2013

tests/ZendTest/View/Helper/PartialLoopTest.php
@@ -453,4 +477,4 @@ public function toArray()
{
return $this->_info;
}
-}
+}
@Ocramius

Ocramius Aug 19, 2013

Member

EOF EOL needed

Member

Ocramius commented Aug 19, 2013

@tranba except for minor CS (EOF EOL) looks good!

tranba commented Aug 19, 2013

@Ocramius CS -> fixed

weierophinney added a commit that referenced this pull request Aug 19, 2013

Merge pull request #4969 from tranba/patch-1
PartialLoop helper: prevent convert traversable model to array recursive...

weierophinney added a commit that referenced this pull request Aug 19, 2013

[#4969] CS fixes
- trailing whitespace

weierophinney added a commit that referenced this pull request Aug 19, 2013

@ghost ghost assigned weierophinney Aug 19, 2013

@weierophinney weierophinney merged commit 91e5641 into zendframework:develop Aug 19, 2013

1 check failed

default The Travis CI build failed
Details

@tranba tranba deleted the tranba:patch-1 branch Aug 20, 2013

@tranba tranba restored the tranba:patch-1 branch Aug 20, 2013

@tranba tranba deleted the tranba:patch-1 branch Mar 15, 2014

@tranba tranba restored the tranba:patch-1 branch Mar 15, 2014

@tranba tranba deleted the tranba:patch-1 branch Mar 15, 2014

weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015

Merge pull request zendframework/zendframework#4969 from tranba/patch-1
PartialLoop helper: prevent convert traversable model to array recursive...

weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment