CGI-Framework

 view release on metacpan or  search on metacpan

lib/CGI/Framework.pm  view on Meta::CPAN

If the second optional parameter is supplied, then that destination key is used in the session.  This allows the key saved in the session to have a different name than the one submitted in the form.  In that case, this method becomes a shorthand for:

	$instance->session($destinationekeyname, $instance->form($sourcekeyname));

It is frequently used to premanently save a submitted form key+value inside the validate_templatename() sub after it has been checked for correctness.

=item return_template($scalar)

This method accepts a scalar template name, and returns the content parsed from that template suitable for sending to the client.  Internally it takes care of language substitution, and the <cgi_framework_header>, <cgi_framework_footer> tags.

In scalar context it returns the content suitable for sending to the client.  In array context it returns the content and the content-type.

=item session($scalar [, $scalar])

This method accepts a scalar key as it's first argument and an optional scalar value as it's second.  If a value is supplied, it saves the key+value pair into the session for future retrieval.  If no value is supplied, it returns the previously-saved...

=item show_template($scalar [, $nofinalize])

This method accepts a scalar template name, calls the pre__pre__all() sub if found, calls the pre_templatename() sub if found, calls the post__pre__all() sub if found, sends the template to the client, calls the pre__post__all() sub if found, calls t...

Note: This method calls finalize() when done unless $nofinalize is set to true.  You probably never want to do this, in which case the call to finalize() will cause this method to never return.

lib/CGI/Framework.pm  view on Meta::CPAN

sub remember {
	my $self           = _getself(\@_);
	my $sourcekey      = shift || croak "key not supplied";
	my $destinationkey = shift || $sourcekey;
	$self->session($destinationkey, $self->form($sourcekey));
}

#
# Takes a template name
# returns scalar output string containing parsed template, with lang and tags substitution
# In array mode also returns a second element which is the content-type
#
sub return_template {
	my $self = _getself(\@_);
	my $template_name = shift || croak "Template name not supplied";
	my $template;
	my $content_type;
	my $filename;
	my $output;
	my ($key, $value);
	my $temp;



( run in 1.991 second using v1.01-cache-2.11-cpan-524268b4103 )