temply
[ class tree: temply ] [ index: temply ] [ all elements ]

Source for file ITagHandler.class.php

Documentation is available at ITagHandler.class.php

  1. <?php
  2. /**
  3.  * ITagHandler.class.php
  4.  * 
  5.  * Every TagHandler for use with Temply should implement this interface.
  6.  * It provides all methods required by Temply.
  7.  * 
  8.  * See http://www.oliver-matuschin.de for more information and version udpates.
  9.  * 
  10.  * @author Oliver Matuschin <mail@oliver-matuschin.de>
  11.  * @copyright Copyright (c) 2010 Oliver Matuschin
  12.  * @license LGPL http://www.gnu.de/documents/lgpl.de.html
  13.  * @version 0.1
  14.  * 
  15.  * @package temply
  16.  */
  17.  
  18. interface ITagHandler {
  19.     /**
  20.      * This method is called by Temply to
  21.      * check whether a given string is a valid tag.
  22.      *
  23.      * @param string The name of the tag to check.
  24.      * @return boolean Should return true if the specified string is a valid tag, false otherwise.
  25.      ***/
  26.     public function isTag($tagName);
  27.     
  28.     /**
  29.      * This method is called by Temply whenever
  30.      * a valid tag is found which does not have any content.
  31.      *
  32.      * @param string The name of the tag.
  33.      * @param array Attributes and values of the tag.
  34.      * @return string Returns the string to be inserted into the template.
  35.      */
  36.     public function processSingleTag($tagNamearray $attributes);
  37.     
  38.     /**
  39. /**
  40.      * This method is called by Temply whenever
  41.      * a valid tag is found which also has an end-tag.
  42.      *
  43.      * @param string The name of the tag.
  44.      * @param array Attributes and values of the tag.
  45.      * @param string The content between the start- and end-tag.
  46.      * @return string Returns the string to be inserted into the template.
  47.      */
  48.     public function processBlockTag($tagNamearray $attributes$blockContent);
  49.     
  50.     /**
  51. /**
  52.      * This method is called by the ThemplateParser <strong>before</strong>
  53.      * the methods processSingleTag or processBlockTag are called.
  54.      * It can be used to change the value of any attribute, if needed.
  55.      *
  56.      * @param string The name of the attribute.
  57.      * @param string The value of the attribute.
  58.      * @param boolean True, if the value of the attribute is quoted, false otherwise.
  59.      * @return string The new value of the given attribute.
  60.      */
  61.     public function preprocessAttribute($attrName$attrValue$quoted);
  62. }
  63. ?>

Documentation generated on Sat, 19 Jun 2010 17:07:51 +0200 by phpDocumentor 1.4.0