NAME
App::Followme::BaseData
SYNOPSIS
use App::Followme::BaseData;
my $meta = App::Followme::BaseData->new();
my %data = $meta->build($name, $filename);
DESCRIPTION
This module is the base class for all metadata classes and provides the build method used to interface metadata classes with the App::Followme::Template class.
Followme uses templates to construct web pages. These templates contain variables whose values are computed by calling the build method of the metadata object, which is passed as an argument to the template function. The build method returns either a reference to a scalar or list. The names correspond to the variable names in the template. This class contains the build method, which couples the variable name to the metadata object method that computes the value of the variable.
METHODS
There is only one public method, build.
- my %data = $meta->build($name, $filename);
-
Build a variable's value. The first argument is the name of the variable to be built. The second argument is the filename the variable is computed for. If the variable returned is a list of files, this variable should be left undefined.
VARIABLES
The base metadata class can evaluate the following variables. When passing a name to the build method, the sigil should not be used. All these variables can only be used inside a for block.
- @loop
-
A list with all the loop items from the immediately enclosing for block.
- @sequence
-
A two item list containing the previous and next items in the for block. If the current item is first or last, the corrsponding item in the sequence list will be the empty string.
- $count
-
The count of the current item in the for block.The count starts at one.
- $is_first
-
One if this is the first item in the for block, zero otherwise.
- $is_last
-
One if this is the last item in the for block, zero otherwise
- $item
-
The current item in the for block.
- $label
-
The string from the comma separated list of labels that corresponds to the current item in a list.
CONFIGURATION
There is one parameter:
- labels
-
A comma separated list of strings containing a list of labels to apply to the values in a loop. The default value is "previous,next" and is meant to be used with @sequence.
LICENSE
Copyright (C) Bernie Simon.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Bernie Simon <bernie.simon@gmail.com>