| Solstice documentation | Contained in the Solstice distribution. |
Solstice::CGI - For getting the CGI form parameters.
use Solstice::CGI;
my $q = param('q'); # param is exported automagically
This gets module exports the ¶m() function by default so you can get form parameters from the Apache request object.
Gets a CGI parameter.
Gets the http header that you would print.
You may optionally create a Solstice::CGI object and call methods on it instead of using the default exported subroutines.
Returns an Apache::Upload object, or undef if there was an error.
Modifies the argument list in place to get rid of $self if present.
Catalyst Group, <catalyst@u.washington.edu>
$Revision$
Copyright 1998-2007 Office of Learning Technologies, University of Washington
Licensed under the Educational Community License, Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.opensource.org/licenses/ecl1.php
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
| Solstice documentation | Contained in the Solstice distribution. |
package Solstice::CGI;
use 5.006_000; use strict; use warnings; our ($VERSION) = ('$Revision$' =~ /^\$Revision:\s*([\d.]*)/); use Solstice::Server; use CGI; use base qw(Solstice::Service Exporter); our @EXPORT = qw(param upload getURLParams getURLParam); our @EXPORT_OK = qw(header);
sub param { _fixArgs(\@_); my $server = Solstice::Server->new(); return $server->param(@_); }
sub header { _fixArgs(\@_); return CGI->new()->header(@_); } sub _setNamedURLParams { my $self = shift; my $args = shift; $self->set('named_url_arg_list', $args); }
sub _setURLParams { my $self = shift; my $args = shift; $self->set('url_arg_list', $args); } sub getURLParam { my $name = shift; return Solstice::CGI->get('named_url_arg_list') ? Solstice::CGI->get('named_url_arg_list')->{$name} : undef; }
sub getURLParams { my $args = Solstice::CGI->get('url_arg_list') || []; return @{$args}; }
sub new { return bless {}, shift; }
sub upload { _fixArgs(\@_); my $server = Solstice::Server->new(); if ($server->getUploadSuccessful()) { return $server->getUpload(shift); } }
sub _fixArgs { my $args = shift; if (defined $args->[0] && ref($args->[0]) eq 'Solstice::CGI') { shift(@$args); } } 1; __END__