Thank you everyone for your helpful feedback and answers.<div><br></div><div>I have uploaded the first version of the recipe</div><div><a href="http://www.pmwiki.org/wiki/Cookbook/NZTopo">http://www.pmwiki.org/wiki/Cookbook/NZTopo</a></div>
<div>(testing it <a href="http://khandallah.wellington.net.nz/pmwiki/pmwiki.php/Main/WikiSandbox">here</a>), as an inexperienced PHP developer treat me gently!</div><div><br></div><div>Let me add to the discussion to say while there is a accepted method of doing this and thats fine,</div>
<div>that it seems to me that for both security and usability reasons better definition of markup directive parameters is a good thing.</div><div><br></div><div>This is where PmWiki could help out recipe writers to some extent with, for example, a precursor function to ParseArgs that might say DefineArgs, allowing regex definition of individual arguments and supporting use of arguments in any order.</div>
<div><br></div><div>thanks</div><div><br></div><div>Simon<br><br><div class="gmail_quote">On 14 July 2013 01:22, Peter Bowers <span dir="ltr"><<a href="mailto:pbowers@pobox.com" target="_blank">pbowers@pobox.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="im"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 12, 2013 at 11:39 PM, Simon <span dir="ltr"><<a href="mailto:nzskiwi@gmail.com" target="_blank">nzskiwi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>most directives accept anything within their scope, then use </div>
<div><font face="courier new, monospace">$arg = ParseArgs($args);</font></div><div><br></div><div>Then the arguments defined are processed, and any unexpected arguments are disregarded.</div><div><br></div><div>So my corollary question is:</div>
<div>Is this good practice, or just expedient, given the difficulty (as I perceive it) of defining a parameter list in regex?</div></blockquote></div><br></div></div><div class="gmail_extra">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).<span class="HOEnZb"><font color="#888888"><br>
<br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra">-Peter<br></div></font></span></div>
</blockquote></div><br></div>