On Fri, Jul 12, 2013 at 11:39 PM, Simon <nzsk...@gmail.com> wrote:

> most directives accept anything within their scope, then use
> $arg = ParseArgs($args);
>
> Then the arguments defined are processed, and any unexpected arguments are
> disregarded.
>
> So my corollary question is:
> Is this good practice, or just expedient, given the difficulty (as I
> perceive it) of defining a parameter list in regex?
>

Yes, both. It's good practice as well as being expedient.  As already
mentioned ParseArgs() is well-tested, elegant code which saves a developer
a ton of time.  At the same time its ability to handle positional or named
parameters and to allow parameters to be specified in any order allows
great flexibility on the part of users entering markup in pages (consider
how difficult it would be if you had to remember the exact order of each
parameter in a complex markup such as pagelist).

-Peter
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Reply via email to