Andrew Sterling Hanenkamp > Contentment-0.011_033 > Contentment::Context

Download:
Contentment-0.011_033.tar.gz

Dependencies

Annotate this POD

Module Version: 0.011_033   Source  

NAME ^

Contentment::Context - Contextual information for a Contentment request

SYNOPSIS ^

  package Contentment::MyModule;

  use strict;
  use warnings;

  sub Contentment::Context::my_module {
      my $ctx = shift;
      return $ctx->{my_module};
  }

  1;

DESCRIPTION ^

The context contains information about the application and the current request-response cycle.

If you need access to the current context object, you can always retrieve it by calling:

  my $context = Contentment->context;

See Contentment for details.

CONTEXT METHODS

To create your own context methods, just drop a method into the Contentment::Context class from your own module:

  sub Contentment::Context::my_method { 1 }

It's recommended that your method throw an exception on error or if it is accessed before it becomes available or after it is no longer available. This will help during debugging.

AUTHOR ^

Andrew Sterling Hanenkamp, <hanenkamp@cpan.org>

LICENSE AND COPYRIGHT ^

Copyright 2005 Andrew Sterling Hanenkamp <hanenkamp@cpan.org>. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

syntax highlighting: