use App::Followme::BaseData; my $meta = App::Followme::BaseData->new(); my %data = $meta->build($name, $filename);
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.
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.
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.
A list with all the loop items from the immediately enclosing for block.
The count of the current item in the for block.The count starts at one.
One if this is the first item in the for block, zero otherwise.
One if this is the last item in the for block, zero otherwise
The name of the current item in the for block.
A string that can be used as a target for the location of the current item in the page.
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.
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.
There are two parameters:
This determines the number of filenames in a merged list. The default value of this parameter is 5
The prefix used to build the target names. The default value is 'target'.
Copyright (C) Bernie Simon.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Bernie Simon <email@example.com>