1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
<?php
/**
* Default HTML Renderer based on templates.
*/
class PhpdocHTMLRenderer extends PhpdocRendererObject {
/**
* Template object
* @var object IntegratedTemplates $tpl
*/
var $tpl;
/**
* XML data accessor object.
* @var object PhpdocAccessor
*/
var $accessor;
/**
* Rootpath for Templatefiles.
* @var string $templateRoot
* @see setTemplateRoot()
*/
var $templateRoot = "";
/**
* Directory path prefix.
* @var string $path
*/
var $path = "";
/**
* Sets a directory path prefix.
*
* @param string
*/
function setPath($path) {
if (""!=$path && "/"!=substr($path, -1))
$path.="/";
$this->path = $path;
} // end func path
/**
* Sets the template directory.
*
* @param string
*/
function setTemplateRoot($templateRoot) {
if (""!=$path && "/"!=substr($templateRoot, -1))
$templateRoot.="/";
$this->templateRoot = $templateRoot;
} // end func setTemplateRoot
/**
* Encodes the given string.
*
* This function gets used to encode all userdependend
* elements of the phpdoc xml files. Use it to
* customize your rendering result: beware newlines (nl2br()),
* strip tags etc.
*
* @param string String to encode
* @return string $string Encoded string
*/
function encode($string) {
return nl2br(htmlspecialchars($string));
} // end func encode
} // end class PhpdocHTMLRenderer
?>
|