本文整理汇总了PHP中HTMLWriter::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLWriter::__construct方法的具体用法?PHP HTMLWriter::__construct怎么用?PHP HTMLWriter::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLWriter
的用法示例。
在下文中一共展示了HTMLWriter::__construct方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/** Build the project overview page.
*
* @param Doclet doclet
*/
public function __construct(&$doclet)
{
parent::__construct($doclet);
$this->_id = 'namespaces';
$rootDoc =& $this->_doclet->rootDoc();
$phpdoctor =& $this->_doclet->phpdoctor();
$packages =& $rootDoc->packages();
ksort($packages);
ob_start();
echo '<header>';
echo '<h1>' . $this->_doclet->_docTitle . '</h1>';
echo '<h2>Overview</h2>';
echo '</header>';
echo '<table>';
foreach ($packages as $packageName => $package) {
echo '<tr><td><a href="' . $package->asPath() . '.html">' . $package->name() . '</a></td></tr>';
}
echo '</table>';
$textTag =& $rootDoc->tags('@text');
if ($textTag) {
$description = $this->_processInlineTags($textTag);
if ($description) {
echo '<h3>Description</h3>';
echo '<div class="comment">', $description, "</div>\n\n";
}
}
$this->_output = ob_get_contents();
ob_end_clean();
$this->_write('namespaces.html', 'Namespaces', true);
}
示例2: __construct
/** Build the package summaries.
*
* @param Doclet doclet
*/
public function __construct(&$doclet)
{
parent::__construct($doclet);
$this->_id = 'frame';
$rootDoc = $this->_doclet->rootDoc();
$phpdoctor = $this->_doclet->phpdoctor();
$packages = $rootDoc->packages();
ksort($packages);
ob_start();
#echo '<h1>'.$this->_doclet->_docTitle.'</h1>';
$namespaces = array();
foreach ($packages as $package) {
$name = explode('\\', $package->name());
$namespaces = $this->placeIntoNamespace($namespaces, $package, $name);
}
$this->outputNamespace($namespaces, $packages);
echo <<<SCRIPT
<script>
window.onload = function () {
var lis = document.getElementsByTagName("li");
for (var foo = 0; foo < lis.length; foo++) {
lis[foo].onclick = function (e) {
e.stopPropagation();
if (this.className == "parent open") {
this.className = "parent";
} else if (this.className == "parent") {
this.className = "parent open";
}
};
}
};
</script>
SCRIPT;
$this->_output = ob_get_contents();
ob_end_clean();
$this->_write('frame.html', 'Frame', true, false);
}
示例3: __construct
/** Build the namespace summaries.
*
* @param Doclet doclet
*/
public function __construct(&$doclet)
{
parent::__construct($doclet);
$this->_id = 'namespace';
$rootDoc =& $this->_doclet->rootDoc();
$phpdoctor =& $this->_doclet->phpdoctor();
$packages =& $rootDoc->packages();
ksort($packages);
foreach ($packages as $packageName => $package) {
$this->_depth = $package->depth();
ob_start();
echo '<header>';
echo '<h1>' . $this->_doclet->_docTitle . '</h1>';
echo "<span>Namespace</span>\n\n";
echo '<h2>', $package->name(), "</h2>\n\n";
echo '</header>';
$classes =& $package->allClasses();
if ($classes) {
ksort($classes);
echo '<table>', "\n";
foreach ($classes as $name => $class) {
$textTag =& $classes[$name]->tags('@text');
echo '<tr><td><a href="', str_repeat('../', $this->_depth), $classes[$name]->asPath(), '">', $classes[$name]->name(), '</a></td>';
echo '<td>';
if ($textTag) {
echo strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>');
}
echo "</td></tr>\n";
}
echo "</table>\n\n";
}
$isSomething = false;
$globals = $package->globals();
if ($globals) {
$isSomething = true;
echo '<h3>Globals</h3>', "\n";
echo '<table>', "\n";
foreach ($globals as $field) {
$textTag =& $field->tags('@text');
echo "<tr>\n";
echo '<td class="type">', $field->modifiers(FALSE), ' ', $field->typeAsString(), "</td>\n";
echo '<td class="description">';
echo '<p class="name"><a href="#', $field->name(), '">';
if (is_null($field->constantValue())) {
echo '$';
}
echo $field->name(), '</a></p>';
if ($textTag) {
echo '<p class="description">', strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>'), '</p>';
}
echo "</td>\n";
echo "</tr>\n";
}
echo "</table>\n\n";
}
$functions = $package->functions();
if ($functions) {
$isSomething = true;
echo '<h3>Functions</h3>', "\n";
echo '<table>', "\n";
foreach ($functions as $function) {
$textTag =& $function->tags('@text');
echo "<tr>\n";
echo '<td class="type">', $function->modifiers(FALSE), ' ', $function->returnTypeAsString(), "</td>\n";
echo '<td class="description">';
echo '<p class="name"><a href="#', $function->name(), '()">', $function->name(), '</a>', $function->flatSignature(), '</p>';
if ($textTag) {
echo '<p class="description">', strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>'), '</p>';
}
echo "</td>\n";
echo "</tr>\n";
}
echo "</table>\n\n";
}
if ($isSomething) {
echo '<h3>Details</h3>', "\n";
if ($globals) {
foreach ($globals as $field) {
$textTag =& $field->tags('@text');
$type =& $field->type();
echo '<code class="signature" id="' . $field->name() . '">', $field->modifiers(), ' ', $field->typeAsString(), ' <strong>';
if (is_null($field->constantValue())) {
echo '$';
}
echo $field->name(), '</strong>';
if (!is_null($field->value())) {
echo ' = ', htmlspecialchars($field->value());
}
echo "</code>\n";
echo '<div class="details">', "\n";
if ($textTag) {
echo $this->_processInlineTags($textTag);
}
$this->_processTags($field->tags());
echo "</div>\n\n";
}
//.........这里部分代码省略.........