本文整理匯總了PHP中H::setContents方法的典型用法代碼示例。如果您正苦於以下問題:PHP H::setContents方法的具體用法?PHP H::setContents怎麽用?PHP H::setContents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類H
的用法示例。
在下文中一共展示了H::setContents方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: A
<?php
$a = new A("Link", "http://www.google.com", array("style" => "color:blue"));
echo $a;
$h1 = new H("1", "This is a h1");
$h2 = new H("2", "This is a h2");
echo $h1 . $h2;
$hr = new HR();
$h1->setContents("This is the new contents");
echo $hr . $h1 . $h2;
$p = new P();
$br = new BR();
$p->setContents("This is some {$br} contents");
echo $p;
$comment = new Comment("This is commented out");
echo $comment;
$img = new Img("https://i.ytimg.com/vi/KY4IzMcjX3Y/maxresdefault.jpg", "This is a dog", array("width" => "100", "height" => "100"));
echo $img;
$table = new Table();
$table->columns(array("col1", "col2", "col3"));
$table->addRow(array("data col1", "data col2", "data col3"));
echo $table;
$list = new BootstrapList();
$list->addLi("item 1")->addLi("item 2");
echo $list;
$div = new Div();
$div->setContents($p . $img);
echo $div;
$span = new Span();
$span->setContents("This is a span");
$div->setContents($span->setContents("This is some new content"));