Doc fixes

This commit is contained in:
Yorhel 2025-03-21 11:29:52 +01:00
parent 0925ae79a1
commit 90881924d4
8 changed files with 62 additions and 61 deletions

32
FU.pm
View file

@ -1046,7 +1046,7 @@ Unless specifically mentioned otherwise, all methods and functions taking or
returning strings deal with perl Unicode strings, not raw bytes.
=head2 Framework Configuration
=head1 Framework Configuration
=over
@ -1143,7 +1143,7 @@ restart loop.
=back
=head2 Handlers & Routing
=head1 Handlers & Routing
=over
@ -1211,7 +1211,7 @@ for a certain error code, C<500> is used as fallback.
=back
=head2 The 'fu' Object
=head1 The 'fu' Object
While the C<FU::> namespace is used for global configuration and utility
functions, the C<fu> object is intended for methods that deal with request
@ -1261,7 +1261,7 @@ Convenient short-hand for C<< fu->db->Q(@args) >>.
=back
=head2 Request Information
=head1 Request Information
=over
@ -1307,6 +1307,16 @@ Parse, validate and return the query parameter identified by C<$name> with the
given L<FU::Validate> schema. Calls C<< fu->error(400) >> with a useful error
message if validation fails.
To fetch a query parameter that may have multiple values, use:
my $arrayref = fu->query(q => {accept_scalar => 1});
# OR:
my $first_value = fu->query(q => {accept_array => 'first'});
# OR:
my $last_value = fu->query(q => {accept_array => 'last'});
=item fu->query($schema)
=item fu->query($name1 => $schema1, $name2 => $schema2, ..)
@ -1326,16 +1336,6 @@ To fetch all query paramaters as decoded by C<query_decode()>, use:
my $data = fu->query({type=>'any'});
To fetch a query parameter that may have multiple values, use:
my $arrayref = fu->query(q => {accept_scalar => 1});
# OR:
my $first_value = fu->query(q => {accept_array => 'first'});
# OR:
my $last_value = fu->query(q => {accept_array => 'last'});
=item fu->cookie(...)
Like C<< fu->query() >> but parses the C<Cookie> request header. Beware that,
@ -1365,7 +1365,7 @@ objects. Refer to L<FU::MultipartFormData> for more information.
=back
=head2 Generating Responses
=head1 Response Generation
=over
@ -1509,7 +1509,7 @@ one of the following status codes or an alias:
=head2 Running the Site
=head1 Running the Site
When your script is done setting L</"Framework Configuration"> and registering
L</"Handlers & Routing">, it should call C<FU::run> to actually start serving