本文整理匯總了PHP中HtmlObject\Element::div方法的典型用法代碼示例。如果您正苦於以下問題:PHP Element::div方法的具體用法?PHP Element::div怎麽用?PHP Element::div使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HtmlObject\Element
的用法示例。
在下文中一共展示了Element::div方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Build a new Media Object
*
* @param string $image Image URL
* @param string $title Title
* @param string $content Content
*/
public function __construct($image, $title, $content)
{
$this->addClass('media');
$image = Image::create($image);
$figure = Element::figure($image)->class('media-object');
$body = Element::div()->class('media-body');
$title = Element::h2($title)->class('media-heading');
$this->nest(array('figure' => $figure, 'body' => $body->nest(array('title' => $title, 'content' => $content))));
}
示例2: testCanRemoveMultipleClassesInStringNotation
public function testCanRemoveMultipleClassesInStringNotation()
{
$tag = Element::div('foo')->class('btn btn-primary btn-large')->removeClass('btn btn-primary');
$this->assertEquals('btn-large', $tag->class);
}
示例3: testCanCheckIfChildrenIsAfterSibling
public function testCanCheckIfChildrenIsAfterSibling()
{
$this->object->nestChildren(array('first' => Element::div(), 'last' => Element::div()));
$first = $this->object->first;
$last = $this->object->last;
$this->assertTrue($last->isAfter('first'));
$this->assertFalse($first->isAfter('last'));
}