carouselItem() public static method

Generates a carousel item.
public static carouselItem ( string $content, string $label, string $caption, array $htmlOptions = [] ) : string
$content string the content.
$label string the item label text.
$caption string the item caption text.
$htmlOptions array additional HTML attributes.
return string the generated item.
示例#1
0
 public function testCarouselItem()
 {
     $I = $this->codeGuy;
     $html = TbHtml::carouselItem('Content text', 'Label text', 'Caption text', array('class' => 'div', 'overlayOptions' => array('class' => 'overlay'), 'labelOptions' => array('class' => 'label'), 'captionOptions' => array('class' => 'caption')));
     $div = $I->createNode($html, 'div.item');
     $I->seeNodeCssClass($div, 'div');
     $I->seeNodeText($div, 'Content text');
     $overlay = $div->filter('div.carousel-caption');
     $I->seeNodeCssClass($overlay, 'overlay');
     $I->seeNodeChildren($overlay, array('h4', 'p'));
     $h4 = $overlay->filter('h4');
     $I->seeNodeCssClass($h4, 'label');
     $caption = $overlay->filter('p');
     $I->seeNodeCssClass($caption, 'caption');
     $I->seeNodeText($caption, 'Caption text');
 }