Re: Modifiers and variables
William McKee <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.petal |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Aug 16, 2004 at 09:42:48AM +0100, Jean-Michel Hiver wrote: > How do you mean? When you write a modifier, you have access to the raw > string that comes after the modifier. What you do with that string is up > to you. Exactly, which is where the problem lies. If each modifier author is writing custom code to break up the string, there is no consistency in Petal's modifiers. > Interesting, maybe this behavior could be implemented in an abstract > modifier which could be subclassed at will. I'm not sure that I follow what you mean by an abstract modifier. Would my custom modifier inherit from that? If so, this is essentially what Petal::Utils is doing now. I was hoping to have a standard method for extracting the arguments from the string but migrating the Plugin modifier architecture from Petal::Utils into Petal would be great (I know Steve would be all for this). > >I like this as it makes it really easy to pass in plain text without > >having to use the string: modifier. However, I'm not sure whether this > >is considered TAL compliant. What are your thoughts? I've included the > >subroutine at the end. > > Well, it's not TALES (TAL Expression Syntax) compliant. However in my > view what's inside the TAL attributes doesn't really matter since it's > pretty much application-dependant anyway. > > Petal has never been TALES compliant since it lets you pass argument to > methods, which in my knowledge is not supported by TALES. That's what I was wondering. Since we're out on a limb, I guess we can make up anything we want. I'm going to add the proposed functionality to Petal::Utils::fetch_arg. Perhaps it can eventually be merged into Petal. Thanks, William -- Knowmad Services Inc. http://www.knowmad.com