ZF-2800: Add placeholder methods to partialLoop
Description
As the great ZF feature partialLoop will be used mostly when it comes to lists etc, it should (in my opinion) also contain the placeholder methods {{setPrefix()}}, {{setSeparator()}}, {{setIndent()}} and {{setPostfix}}. This way you'll be able to use the partialLoop to loop through an array with those html tags added. For example, I have created a partial which shows a single instance of an item. If there is only 1 item, I don't want to place it in a list. If there are more items, I want to use partialLoop to create a list with prefix {{
- }}, separator {{
- }} and postfix {{
}}.
I am now forced to either write my own {{foreach}} loop, or to add a partialLoop file which contains nothing more than {{
<?php echo $this->partial('myPartial.phtml', $this); ?>}}. In both example I don't get the performance benefits partialLoop should give me.
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2008-03-06T09:57:25.000+0000
Scheduling for first mini-release following 1.5.0 GA release.
Posted by Wil Sinclair (wil) on 2008-03-21T17:05:29.000+0000
This issue should have been fixed for the 1.5 release.
Posted by Wil Sinclair (wil) on 2008-03-25T20:33:29.000+0000
Please categorize/fix as needed.
Posted by Wil Sinclair (wil) on 2008-04-18T13:11:49.000+0000
This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
Posted by Ralph Schindler (ralph) on 2008-04-22T10:28:46.000+0000
Updating project management info.
Posted by Jason Eisenmenger (jasoneisen) on 2008-09-10T13:46:20.000+0000
In my opinion, every single view helper could use the setIndent() method. I could much use this on actions, placeholders, forms, etc...
Posted by Jason Eisenmenger (jasoneisen) on 2008-09-10T13:51:16.000+0000
As an example, I am currently doing this in one projects layout file to get the content to indent properly:
Posted by Matthew Weier O'Phinney (matthew) on 2009-02-06T09:35:33.000+0000
This sounds like a mismatch between your expectations of the components and their intended purpose. If you want to use prefix/postfix/separator, simply loop over a variable and append the content to a placeholder:
If you want a common indentation method for helpers, please open a separate request.