If you are interested in the template, you can display code by doing the following in the html:
<pre>
Code goes here
</pre>
Web Developer / IT Manager / Magic Maker
<pre>
Code goes here
</pre>
isInternal() ? 'internal' : 'user-defined',
$class->isAbstract() ? ' abstract' : '',
$class->isFinal() ? ' final' : '',
$class->isInterface() ? 'interface' : 'class',
$class->getName(),
var_export($class->getParentClass(), 1),
$class->getFileName(),
$class->getStartLine(),
$class->getEndline()
);
echo "class " . $class->getName() . " {\n\n";
// Print class methods
echo "//Functions\n";
$methods = $class->getMethods();
foreach ($methods as $method) {
$class_method = new ReflectionMethod($method->class, $method->name);
$parameters = $class_method->getParameters();
$params = array();
foreach ($parameters as $parameter) {
$param_string = '$' . $parameter->getName();
if ($parameter->isPassedByReference()) $param_string = '&' . $param_string;
if ($parameter->isOptional() && $parameter->isDefaultValueAvailable())
$param_string .= ' = '.$parameter->getDefaultValue();
$params[] .= $param_string;
}
$method_params = implode(', ', $params);
//Comments Section
echo "\n\t/**\n";
foreach ($params as $i) {
echo "\t* @param $i\n";
}
if (!count($params)) echo "\t*\n";
echo "\t*/\n";
printf(
"\t%s%s%s%s%s%s function %s ( %s ) {}\n" ,
$class_method->isAbstract() ? ' abstract' : '',
$class_method->isFinal() ? ' final' : '',
$class_method->isPublic() ? ' public' : '',
$class_method->isPrivate() ? ' private' : '',
$class_method->isProtected() ? ' protected' : '',
$class_method->isStatic() ? ' static' : '',
$class_method->getName(),
$method_params
);
}
echo "\n}\n\n";
// Print class constants
echo "//Constants\n";
foreach ($class->getConstants() as $constant_name => $constant_value) {
echo "define('".$class->getName()."::$constant_name', $constant_value);\n";
}
?>