NAME
Template::Direct::Base - Basic class for content sections
DESCRIPTION
Provide the low level functions applicable to all content sections
METHODS
$class->new( $data )
Create a new instance object.
$construct->singleTag( )
Return true if this construct will be a single tag.
i.e [tag/]
$construct->subTags( )
Should return a list of valid child tags.
$construct->hasTag( $name )
Return true if this construct has a named tag.
$construct->hasSubTag( $name )
Return true if this construct has a named sub tag.
$construct->allSubTags( )
Return an ARRAY ref of sub tag objects.
$construct->addSubTag( $name, $index, $data )
Used internally to add a sub tag element to this construct.
$construct->addEndSubTag( $name, $index )
Complete a sub tag by closing it, used internally.
$construct->endTag( )
The tag id for the end tag of this construct.
$construct->startTag( )
The tag id for the start tag of this construct.
$construct->setEndTag( $index )
Set the id of the end tag of this construct.
$construct->addChild( $object )
Used internally to add a child construct to this one.
$construct->setParent( $object )
Set the parent object of this construct to $object.
$construct->setClassParent( $object )
Set the last parent which had the same class as this construct.
$construct->children( )
Return an ARRAY ref of child constructs.
$construct->parent( )
Return the parent construct (if available)
$construct->depth( )
Return the depth number for this tag.
$construct->classParent( )
Return the next parent with the same class as this one.
$construct->classDepth( )
Return the depth number for this tag counting only tags
of the same class as this one.
$construct->getParent( $depth )
Get a parent at a certain depth.
$construct->getClassParent( $depth )
Get the class parent of a certin depth.
$construct->compile( $data, $content, %p )
Used internally to cascade the compilation to all children
and replace and variables with $data as required.
$construct->compileChildren( $data, $content, %p )
Used internally, loop through all children and compile them
with the same data and content.
$object->getOptions( $line )
Returns a hash ref of name vale pairs and described as a string in line.
The line: "var='xyz' depth=0" becomes { var => 'xyz', depth => '0' }
$object->getSection( $content, $start, $end )
Returns a section of a content between two tag indexes.
Having two sections with the same tag indexes is not valid
It's expected that code that deals with listing splits up
it's calls to this method as a matter of structure.
$construct->getLocation( $content, $tagIndex )
Replaces a tag location with a temporty pointer.
$construct->getFullSection( $content )
Returns getSection of the current objects start and end tags
$construct->setSection( $content, $result )
Sets the section back into the content (see getSection)
$construct->setTagSection( $content, $tagIndex, $with )
Sets the section back into the content tag directly
$construct->getAppendedSection( $content, $startEntry, $endEntry )
Returns the content between start and end tags, removing the start tag but
only removing the end tag if it's an end tag for the start tag.
$construct->replaceData( \$content, $data )
Replace all instances in content with required data
$construct->cleanContent( \$content )
Removes any remaining content syntax from content
AUTHOR
Martin Owens - Copyright 2007, AGPL