Author image Martin Owens


Template::Direct::Conditional - Handle a conditonal in a template


  Provide support for conditionals in templates

$class->new( $index, $line )

  Create a new instance object.

$if->tagName( )

  Returns 'if'

$if->subTags( )

  Returns a list of expected sub tags: [else, elif]

$if->conditional( )

  Returns the conditional statement fromt he template.

$if->compile( )

  Modifies a template with the data listed correctly.

$if->parseConditional($tokenString, $dataStructure)

  Reduce a string conditional into a boolean

$if->parseLogical( $tokens )

    Take tokens and group logical statements by and/or


Template::Direct::Conditional::Tokens - Handle a list of conditional tokens


$class->new( $list )

  Return a list of tokens object.

$tokens->executeConditional( $conditional )

    suck in triples and output booleans

$tokens->in( $a, $b )

  Returns true if $b (ARRAY REF) contains $a.

$tokens->append( $item )

  Add a token to this token list.

$tokens->lastItem( )

  Return the last item from this token list.

$tokens->iterator( )

  Return the token list as an array.


  Martin Owens - Copyright 2007, AGPL