本文整理汇总了PHP中HtmlElement::setBody方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlElement::setBody方法的具体用法?PHP HtmlElement::setBody怎么用?PHP HtmlElement::setBody使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlElement
的用法示例。
在下文中一共展示了HtmlElement::setBody方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetBody
/**
* @covers HtmlElement::getBody
*/
public function testGetBody()
{
$body = "html body";
$elt = $this->element->setBody($body);
$actual = $elt->getBody();
$this->assertInstanceOf("HtmlElement", $elt);
$this->assertEquals($body, $actual);
}
示例2: begin
public function begin()
{
echo $this->getElementOpenTag() . "\n";
$legend = new HtmlElement("legend");
$legend->setBody($this->title);
echo $legend;
$this->started = true;
}
示例3: label
/**
* Dispaly a label for a field.
* If the field is required, the css class 'required' will be added to
* the label's element.
*
* @param $name string the field name
* @param $title string the title to display.
* @return HtmlElement
*/
public function label($name, $title)
{
$cssClasses = array();
$this->labels[$name] = $this->removeEndColon($title);
$span = new HtmlElement("label");
$span->setBody($title);
if ($this->findConstraint($name, ConstraintFactory::REQUIRED)) {
$cssClasses[] = 'required';
}
if (isset($this->field_errors[$name])) {
$styleClass = Config::getInstance()->getString("webapp/ui/errorCssClass", "error");
$cssClasses[] = $styleClass;
}
if (count($cssClasses) > 0) {
$span->set("class", implode(' ', $cssClasses));
}
return $span;
}