Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

html::mason::resolver(3pm) [debian man page]

HTML::Mason::Resolver(3pm)				User Contributed Perl Documentation				HTML::Mason::Resolver(3pm)

NAME
HTML::Mason::Resolver - Component path resolver base class SYNOPSIS
# make a subclass and use it DESCRIPTION
The resolver is responsible for translating a component path like /foo/index.html into a component. By default, Mason expects components to be stored on the filesystem, and uses the HTML::Mason::Resolver::File class to get information on these components. The HTML::Mason::Resolver provides a virtual parent class from which all resolver implementations should inherit. Class::Container This class is used by most of the Mason object's to manage constructor parameters and has-a relationships with other objects. See the documentation on this class for details on how to declare what paremeters are valid for your subclass's constructor. HTML::Mason::Resolver is a subclass of Class::Container so you do not need to subclass it yourself. METHODS
If you are interested in creating a resolver subclass, you must implement the following methods. new This method is optional. The new method included in this class is simply inherited from "Class::Container". If you need something more complicated done in your new method you will need to override it in your subclass. get_info Takes three arguments: an absolute component path, a component root key, and a component root path. Returns a new HTML::Mason::ComponentSource object. glob_path Takes two arguments: a path glob pattern, something like "/foo/*" or "/foo/*/bar", and a component root path. Returns a list of component paths for components which match this glob pattern. For example, the filesystem resolver simply appends this pattern to the component root path and calls the Perl "glob()" function to find matching files on the filesystem. Using a Resolver with HTML::Mason::ApacheHandler If you are creating a new resolver that you intend to use with the HTML::Mason::ApacheHandler module, then you must implement the following method as well. apache_request_to_comp_path ($r, @comp_root_array) This method, given an Apache object and a list of component root pairs, should return a component path or undef if none exists. This method is used by the HTML::Mason::ApacheHandler class to translate web requests into component paths. You can omit this method if your resolver subclass will never be used in conjunction with HTML::Mason::ApacheHandler. SEE ALSO
HTML::Mason perl v5.14.2 2012-02-04 HTML::Mason::Resolver(3pm)

Check Out this Related Man Page

HTML::Mason::Compiler::ToObject(3pm)			User Contributed Perl Documentation		      HTML::Mason::Compiler::ToObject(3pm)

NAME
HTML::Mason::Compiler::ToObject - A Compiler subclass that generates Mason object code SYNOPSIS
my $compiler = HTML::Mason::Compiler::ToObject->new; my $object_code = $compiler->compile( comp_source => $source, name => $comp_name, comp_path => $comp_path, ); DESCRIPTION
This Compiler subclass generates Mason object code (Perl code). It is the default Compiler class used by Mason. PARAMETERS TO THE new() CONSTRUCTOR All of these parameters are optional. comp_class The class into which component objects are blessed. This defaults to HTML::Mason::Component. subcomp_class The class into which subcomponent objects are blessed. This defaults to HTML::Mason::Component::Subcomponent. in_package This is the package in which a component's code is executed. For historical reasons, this defaults to "HTML::Mason::Commands". preamble Text given for this parameter is placed at the beginning of each component, but after the execution of any "<%once>" block. See also postamble. The request will be available as $m in preamble code. postamble Text given for this parameter is placed at the end of each component. See also preamble. The request will be available as $m in postamble code. use_strict True or false, default is true. Indicates whether or not a given component should "use strict". named_component_subs When compiling a component, use uniquely named subroutines for the a component's body, subcomponents, and methods. Doing this allows you to effectively profile Mason components. Without this, all components simply show up as __ANON__ or something similar in the profiler. define_args_hash One of "always", "auto", or "never". This determines whether or not an %ARGS hash is created in components. If it is set to "always", one is always defined. If set to "never", it is never defined. The default, "auto", will cause the hash to be defined only if some part of the component contains the string "ARGS". This is somewhat crude, and may result in some false positives, but this is preferable to false negatives. Not defining the args hash means that we can avoid copying component arguments, which can save memory and slightly improve execution speed. ACCESSOR METHODS
All of the above properties have read-only accessor methods of the same name. You cannot change any property of a compiler after it has been created (but you can create multiple compilers with different properties). METHODS
This class is primarily meant to be used by the Interpreter object, and as such has a very limited public API. compile(...) This method will take component source and return the compiled object code for that source. See "compile(...)" in HTML::Mason::Compiler for details on this method. This subclass also accepts a "comp_class" parameter, allowing you to override the class into which the component is compiled. perl v5.14.2 2012-02-04 HTML::Mason::Compiler::ToObject(3pm)
Man Page