The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Statocles::Theme - Templates, headers, footers, and navigation

VERSION

version 0.017

SYNOPSIS

    # Template directory layout
    /theme/site/layout.html.ep
    /theme/blog/index.html.ep
    /theme/blog/post.html.ep

    my $theme      = Statocles::Theme->new( path => '/theme' );
    my $layout     = $theme->template( site => 'layout.html' );
    my $blog_index = $theme->template( blog => 'index.html' );
    my $blog_post  = $theme->template( blog => 'post.html' );

DESCRIPTION

A Theme contains all the templates that applications need. This class handles finding and parsing files into template objects.

When the "path" is read, the templates inside are organized based on their name and their parent directory.

ATTRIBUTES

path

The source directory for this theme.

If the path begins with ::, will pull one of the Statocles default themes from the Statocles share directory.

templates

The template objects for this theme.

METHODS

BUILDARGS

Handle the path :: share theme.

read()

Read the path and create the template objects inside.

template( $section => $name )

Get the template from the given section with the given name.

coercion

Class method to coerce a string representing a path into a Statocles::Theme object. Returns a subref suitable to be used as a type coercion in an attriute.

AUTHOR

Doug Bell <preaction@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Doug Bell.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.