Here is an idea:
http://pastebin.ca/665838
Since Partial is what I consider a "stateless helper", i dont see an
issue in allowing for the signature of the helper to determine its
behavior. For example, my implementation (as noted above), could be
changed to this:
public function partial($script, $variables = array(), $options = null)
{ .. }
Where options can be a string or array (of options), if a string, it
would match the optional const's defined in the class, the two that come
to mine are, CLEAR and LOOPVARS.
Jack Sleight wrote:
Yeah, I guess that would make sense. The only reason I called it
collection was because that's what its called in Rails
(http://api.rubyonrails.com/classes/ActionController/Base.html),
although strictly speaking, the php equivalent would actually be
partialCollection(), but that's a bit too long.
Of the two you suggested, I think partialLoop() makes the most sense. Or
perhaps partialRepeat(), to remain (sort of) consistent with
str_repeat()? Also, most synonyms of the words collection or repeat
would make sense e.g. partialSet(), partialGroup(). I'm not too fussed
really, go with the one you feel makes the most sense.
Matthew Weier O'Phinney wrote:
-- Jack Sleight <[EMAIL PROTECTED]> wrote
(on Tuesday, 21 August 2007, 04:33 PM +0100):
Since it's basically re-using a partial within a loop, what do you think
about calling it 'partialLoop' or 'loopPartial'? I think it would be
good to keep thenaming consistent with the functionality. Thoughts?
--
Jack