1Mojo::Parameters(3)   User Contributed Perl Documentation  Mojo::Parameters(3)
2
3
4

NAME

6       Mojo::Parameters - Parameter Container
7

SYNOPSIS

9           use Mojo::Parameters;
10
11           my $params = Mojo::Parameters->new(foo => 'bar', baz => 23);
12           print "$params";
13

DESCRIPTION

15       Mojo::Parameters is a container for form parameters.
16

ATTRIBUTES

18       Mojo::Parameters implements the following attributes.
19
20   "charset"
21           my $charset = $params->charset;
22           $params     = $params->charset('UTF-8');
23
24       Charset used for decoding parameters.
25
26   "pair_separator"
27           my $separator = $params->pair_separator;
28           $params       = $params->pair_separator(';');
29
30       Separator for parameter pairs.
31
32   "params"
33           my $parameters = $params->params;
34           $params        = $params->params(foo => 'b;ar', baz => 23);
35
36       The parameters.
37

METHODS

39       Mojo::Parameters inherits all methods from Mojo::Base and implements
40       the following new ones.
41
42   "new"
43           my $params = Mojo::Parameters->new;
44           my $params = Mojo::Parameters->new('foo=b%3Bar&baz=23');
45           my $params = Mojo::Parameters->new(foo => 'b;ar', baz => 23);
46
47       Construct a new Mojo::Parameters object.
48
49   "append"
50           $params = $params->append(foo => 'ba;r');
51
52       Append parameters.
53
54   "clone"
55           my $params2 = $params->clone;
56
57       Clone parameters.
58
59   "merge"
60           $params = $params->merge($params2, $params3);
61
62       Merge parameters.
63
64   "param"
65           my $foo = $params->param('foo');
66           my @foo = $params->param('foo');
67           my $foo = $params->param(foo => 'ba;r');
68
69       Check parameter values.
70
71   "parse"
72           $params = $params->parse('foo=b%3Bar&baz=23');
73
74       Parse parameters.
75
76   "remove"
77           $params = $params->remove('foo');
78
79       Remove a parameter.
80
81   "to_hash"
82           my $hash = $params->to_hash;
83
84       Turn parameters into a hashref.
85
86   "to_string"
87           my $string = $params->to_string;
88
89       Turn parameters into a string.
90

SEE ALSO

92       Mojolicious, Mojolicious::Guides, <http://mojolicious.org>.
93
94
95
96perl v5.12.3                      2010-08-12               Mojo::Parameters(3)
Impressum