Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

HTML::Mason::Resolver::File
Component path resolver for file-based components

HTML::Mason::Resolver::File - Component path resolver for file-based components


NAME

HTML::Mason::Resolver::File - Component path resolver for file-based components


SYNOPSIS


  my $resolver = HTML::Mason::Resolver::File->new( comp_root => '/var/www/mason' );

  my $info = $resolver->get_info('/some/comp.html');

  my $comp_root = $resolver->comp_root;


DESCRIPTION

This HTML::Mason::Resolver subclass is used when components are stored on the filesystem, which is the norm for most Mason-based applications.


PARAMETERS TO THE new() CONSTRUCTOR

The new method takes a single parameter, comp_root.

comp_root
The component root marks the top of your component hierarchy and defines how component paths are translated into real file paths. For example, if your component root is /usr/local/httpd/docs, a component path of /products/index.html translates to the file /usr/local/httpd/docs/products/index.html.

Under Apache and CGI, comp_root defaults to the server's document root. In standalone mode comp_root defaults to the current working directory.

This parameter may be either a scalar or an array reference. If it is a scalar, it should be a filesystem path indicating the component root. If it is an array reference, it should be of the following form:


 [ [ key1 => '/path/to/root' ],

   [ key2 => '/path/to/other/root' ] ]

The ``keys'' for each path must be unique names and their ``values'' must be filesystem paths. These paths will be searched in the provided order whenever a component path must be resolved to a filesystem path.

If no component root is specified, the current working directory is used.


ADDITIONAL METHODS

comp_root
This method returns the component root, which will either be a scalar or an array reference, as documented here.

comp_root_array
Returns the component root as an array of name/path pairs. Can be used like the following:

  foreach my $pair ($self->comp_root_array) {

    my ($name, $path) = @$pair;

    ...

  }


SEE ALSO

HTML::Mason

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy