Packages » Package html » Class HTMLPHPSource

Class HTMLPHPSource

Declaration:
<? class HTMLPHPSource extends HTMLTag ?>

Description:
This tag is used to automatically highlight PHP source in your templates. You use it like any other formatting tag, just enclose the code you want to highlight with this tag:
 <HTMLPHPSource>
    $x = $y + 2;
    $z = doMath($x, $y);
    print $z;
 </HTMLPHPSource>
 
Please note you do not enclose the source with the PHP open and close tags! You can also use template variables inside this tag, if you preset them with valid fragment of PHP source code. Please note that inside this tag you will not be able to use the less-than sign as the parser will consider it a beginning of a new tag. Instead, just use the < entity reference like: $x <= 10


Parent Classes:
SDNode , SDElement , HTMLTag

Authors:
  • Dennis Popel

Methods:
  • isExposed()
    Returns true if the tag is exposed
  • onClose()
    Override this to take some action (possibly restore own children state and attributes) after the template has finished processing the body of the tag.
  • onOpen()
    Override this to take some action (possibly modify own children state and own attributes) and decide whether to process the body. Please note that this method can be called multiple times on the same instance if the tag is repeated with the body of parent tag.