[pmwiki-users] Announcement: Page Variable Extensions recipe

Marc Cooper gmane at auxbuss.com
Fri Jun 30 07:41:46 CDT 2006


Dominique Faure said...
> On 6/30/06, Martin Fick <mogulguy at yahoo.com> wrote:
> > Dominique,
> > One feature I like is the ability to explicitly
> > differentiate where the variables came from, GET,
> > POST, COOKIES?  This really is reminiscent of the old
> > days of PHP where everything shared the same namespace
> > and then it was realized that it is often helpful to
> > separate them.  Having separate namespaces can help
> > prevent a user from overriding a page's intent with
> > URLs.
> 
> I like the way you made it as it only deals with the arguments you
> explicitely refers to (ie this protects the further page logic from
> hand-crafted/mis-typed reference with unwanted variables initialized).
> But, I'm not very keen on the syntax extension you defined, since it
> tends to pollute the page directive namespace, providing too much ways
> to address things which have the same nature/purpose.
> I would prefer to improve the (:set ...:) directive to handle explicit
> initializations from url/posts/cookies parameters with something like:
> 
> (:set v1='@(get param_name default_value)' :)

Why '@' in the syntax?
 
> where you may replace 'get' by 'post' or 'req'.
> The cookie handling would need more parameters to manage domain and/or expiry.
> In the same mood, we may also handle session datas.

Sessions would be good - I already started looking at adding them ;-) I 
never use cookies - session cookie excepted.

-- 
Best,
Marc





More information about the pmwiki-users mailing list