|
||||
|
||||
|
| View source (Text/Wigwam/Modules/Core/Cgi.pm) |
|
NameText::Wigwam::Modules::Core::Cgi - A Wigwam module.
DescriptionThis module contains directives useful for accessing CGI environment variables, and managing query strings and other forms of web encoded data.
Directives
#cgi::postRetrieves a URI encoded query string via the POST method and returns a hash complex containing the decoded data.
#cgi::get_queryRetrieves a URI encoded query string based upon the relevant GET or POST method and returns a hash complex containing the decoded data.
#cgi::envReturns a reference to Perl's %ENV hash.
#cgi::parse_query stringParses the URI encoded string and returns a reference to a hash reference containing the decoded data. [!! #define Query #cgi::parse_query "name.first=Fred&name.last=Mertz" !!] First name: [!! Query.name.first !!], Last name: [!! Query.name.last !!] [!! /* output: First name: Fred, Last name: Mertz */ !!]
#cgi::make_query hashPerforms the reverse of
[!!
#cgi::make_query %<
one "single"
two "twice that of one"
three "more than you need"
>
/* output (order will vary):
three=more+than+you+need&one=single&two=twice+that+of+one
*/
!!]
#cgi::parse_cookies http_cookiesReturns a reference to a hash complex containing decoded data generated from encoded http_cookies data. [!! #define cookies #cgi::parse_cookies "foo.bar=bazz; bar.foo=quux" !!] foo.bar = [!! cookies.foo.bar !!] bar.foo = [!! cookies.bar.foo !!] [!! /* output: foo.bar = bazz bar.foo = quux */ !!]
#cgi::make_cookies hashPerforms the reverse of
[!!
#cgi::make_cookies %<
one "single"
two "twice that of one"
three "more than you need"
>
/* output (order will vary):
three=more+than+you+need; one=single; two=twice+that+of+one
*/
!!]
#cgi::encode stringReturns a URI encoded version of string. [!! #cgi::encode "Four score & seven years ago" /* output: Four+score+&+seven+years+ago */ !!]
#cgi::decode stringReturns a URI decoded version of string. [!! #cgi::decode "Four+score+&+seven+years+ago" /* output: Four score & seven years ago */ !!] |