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.
- $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
- $name
-
The name of the current item in the for block.
- $target
-
A string that can be used as a target for the location of the current item in the page.
- $target_next
-
A string that can be used as a target for the location of the next item in the page. Empty if there is no next item.
- $target_previous
-
A string that can be used as a target for the location of the previous item in the page. Empty if there is no previous item.
CONFIGURATION
There are two parameters:
- list_length
-
This determines the number of filenames in a merged list. The default value of this parameter is 5
- target_prefix
-
The prefix used to build the target names. The default value is 'target'.
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>