[pmwiki-users] Announcement: Page Variable Extensions recipe

Martin Fick mogulguy at yahoo.com
Thu Jun 29 22:52:30 CDT 2006


Dominique,

That is a very cool recipe!  Have you seen my
HttpVariables recipe?  Before implementing that I was
thinking of adding that functionality to your recipe. 
I think that I decided against it simply for naming
reasons (they weren't actually page variables), but it
might make sense to merge our recipes.  I am not
particularly attached to mine, but it has a few extra
nifty features that I would like to keep.  I don't
like proliferating too many recipes.  What do you
think?

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.

-Martin


--- Dominique Faure <dominique.faure at gmail.com> wrote:

> Announcing (officially) the Page Variable Extensions
> recipe at:
> 
>
http://www.pmwiki.org/wiki/Cookbook/PageVariableExtensions
> 
> This recipe enhances the variable features in
> several ways, providing
> markup and suffixes functions to dynamically
> initialize and manipulate
> their values in wiki's pages such as:
> 
> (:set msg='{$Name:toupper} is here!':)
> oyez, oyez, {$msg}
> 
> which would render as:
> 
> oyez, oyez, PAGEVARIABLEEXTENSIONS is here!
> 
> Roughly, the recipe provides the (:set ...:) markup
> directive to
> initialize/assign page variables, eventually using
> previously defined
> ones (cf. sample above), including a way to handle
> conditional
> assignation as in:
> 
> (:set flag=1 mood='?(eq {$flag} 1) "nice" "weird"':)
> "This recipe is {$mood}"
> 
> rendering as example below according to the value of
> the {$flag} variable:
> 
> "This recipe is nice"
> 
> Most of the native simple text manipulation
> functions provided by PHP
> are available as Suffixes functions, and the recipe
> may be easily
> enhanced with your own ones if needed. Function
> calls calls may be
> chained as in:
> 
> {$Namespaced:tolower:replace ' ' '_'}
> 
> which would transform "PageVariableExtensions" to
> "page_variable_extensions", and with the help of a
> modified variable
> syntax allow computed values during argument passing
> as in:
> 
> (:set var='abcdef' s1=2 s2=4:)
> {$var:sub <$s1> 3} / {$var:sub <$s2> 3}
> 
> which renders as: cde / ef
> 
> Regards,
> Dom
> 
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
>
http://host.pmichaud.com/mailman/listinfo/pmwiki-users
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the pmwiki-users mailing list