NAME

GT::Template::Inheritance - Provides class methods to deal with template inheritance.


SYNOPSIS

    use GT::Template::Inheritance;
    my $file = GT::Template::Inheritance->get_path(
        file => "foo.htm",
        path => "/path/to/my/template/set",
        use_local => 1,
        use_inheritance => 1
    );
    my @files = GT::Template::Inheritance->get_all_paths(
        file => "foo.htm",
        path => "/path/to/my/template/set",
        use_local => 1,
        use_inheritance => 1,
        local_inheritance => 1
    );


DESCRIPTION

GT::Template::Inheritance is a simple module with nothing but class methods to return the path or paths to files following template inheritace files and locals. See the GT::Template manpage for a description of how inheritance and locals works.


METHODS

All methods in GT::Template::Inheritance are class methods. Each method takes a hash of options as an argument.

get_path

This method returns the path to the proper file given options. The options are given in the form of a hash.

The following options are required.

file
This should be the name of the file you are looking for.

path
This should be the path to the template directory you are looking for the file in.

The following options are not required. If omitted default to on.

use_local
This says whether to return the local copy of the file if found rather than the unmodified copy.

use_inheritance
This open specifies whether to search the inheritance tree for the file you are looking for. The search starts in the path you provided.

get_all_paths

This method returns all files it finds while looking through inheritance and or locals.

The following options are required.

file
This should be the name of the file you are looking for.

path
This should be the path to the template directory you are looking for the file in.

The following options are not required.

use_local
Boolean, should we include files in the local directory if they exist. Defaults to on.

use_inheritance
Boolean, should we search the inheritance tree for files. Defaults to on.

local_inheritance
Boolean, should we include both local and root file if they both exist. Defaults to the value of use_inheritance. Only applies to get_all_paths(), not get_path().


SEE ALSO

the GT::Template manpage


MAINTAINER

Jason Rhinelander


COPYRIGHT

Copyright (c) 2004 Gossamer Threads Inc. All Rights Reserved. http://www.gossamer-threads.com/


VERSION

Revision: $Id: Inheritance.pm,v 1.5 2004/05/04 01:41:01 jagerman Exp $