root/trunk/extensions/patXMLRendererYourNameExtension.php
| Revision 2 (checked in by schst, 5 years ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | <?PHP |
| 2 | /** |
| 3 | * pat XML Renderer - EXTENSIONNAME Extension |
| 4 | * Use this as a template for new extensions |
| 5 | * |
| 6 | * @access public |
| 7 | * @version 0.1 |
| 8 | * @author YOUR NAME <YOU@YOURDOMAIN.COM> |
| 9 | * @package patXMLRenderer |
| 10 | */ |
| 11 | |
| 12 | class patXMLRendererYourNameExtension extends patXMLRendererExtension |
| 13 | { |
| 14 | |
| 15 | /** |
| 16 | * name of the extension |
| 17 | * @var string $name |
| 18 | */ |
| 19 | var $name = "patXMLYourNameExtension"; |
| 20 | |
| 21 | /** |
| 22 | * version of the extension |
| 23 | * @var string $version |
| 24 | */ |
| 25 | var $version = "0.1"; |
| 26 | |
| 27 | /** |
| 28 | * version of patXMLRenderer that is required |
| 29 | * @var string $requiredRandyVersion |
| 30 | */ |
| 31 | var $requiredRandyVersion = "0.5"; |
| 32 | |
| 33 | /** |
| 34 | * array containing a flag for each supported tag to indicate if this tag is cacheable |
| 35 | * @var array $cacheAble |
| 36 | */ |
| 37 | var $cacheAble = array( |
| 38 | "MYTAG" => true |
| 39 | ); |
| 40 | /** |
| 41 | * array containing a flag for each supported tag to indicate if this tag returns markup |
| 42 | * @var array $containsMarkup |
| 43 | */ |
| 44 | var $containsMarkup = array( |
| 45 | "MYTAG" => false |
| 46 | ); |
| 47 | |
| 48 | /** |
| 49 | * handle an end element |
| 50 | * |
| 51 | * @param int $parser resource id of the current parser |
| 52 | * @param string $ns namespace |
| 53 | * @param string $name name of the element |
| 54 | */ |
| 55 | function endElement( $parser, $ns, $tag ) |
| 56 | { |
| 57 | $data = $this->getData(); |
| 58 | $attributes = array_pop( $this->attStack ); |
| 59 | $tag = array_pop( $this->tagStack ); |
| 60 | |
| 61 | switch( $tag ) |
| 62 | { |
| 63 | case "MYTAG": |
| 64 | $content = ""; |
| 65 | |
| 66 | // place anything here, that generates the content |
| 67 | |
| 68 | return $content; |
| 69 | break; |
| 70 | |
| 71 | // did not know the tag => do nothing! |
| 72 | default: |
| 73 | return false; |
| 74 | break; |
| 75 | } |
| 76 | return false; |
| 77 | } |
| 78 | } |
| 79 | ?> |
| 80 |
Note: See TracBrowser for help on using the browser.
