本文整理汇总了PHP中TbHtml::carousel方法的典型用法代码示例。如果您正苦于以下问题:PHP TbHtml::carousel方法的具体用法?PHP TbHtml::carousel怎么用?PHP TbHtml::carousel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TbHtml
的用法示例。
在下文中一共展示了TbHtml::carousel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<div class="container" style="height:80%; width:600px;">
<br/>
<h2><div style="text-align:center;">Welcome to Morena e-Salary Slip</div></i></h2>
<p><div style="text-align:center;"><i>MORENA's</i> E-Salary Slip Application</div></p>
<hr/>
<?php
echo TbHtml::carousel(array(array('image' => Yii::app()->request->baseUrl . '/images/image2.jpg', 'label' => 'PT MANDIRI CIPTA SEJAHTERA', 'caption' => 'MORENA')));
?>
</div><br/><br/>
示例2: testCarousel
public function testCarousel()
{
$I = $this->codeGuy;
$items = array(array('image' => 'image.png', 'label' => 'First Thumbnail label', 'url' => '#', 'caption' => 'Caption text'), array('image' => 'image.png', 'label' => 'Second Thumbnail label'), array('image' => 'image.png', 'imageOptions' => array('class' => 'image', 'alt' => 'Alternative text')));
$html = TbHtml::carousel($items, array('id' => 'carousel', 'class' => 'div'));
$carousel = $I->createNode($html, 'div.carousel');
$I->seeNodeCssClass($carousel, 'div slide');
$I->seeNodeAttribute($carousel, 'carousel');
$I->seeNodeChildren($carousel, array('ol.carousel-indicators', 'div.carousel-inner', 'a.carousel-control', 'a.carousel-control'));
$inner = $carousel->filter('div.carousel-inner');
foreach ($inner->children() as $i => $divElement) {
$div = $I->createNode($divElement);
$I->seeNodeCssClass($div, 'item');
switch ($i) {
case 0:
$I->seeNodeCssClass($div, 'active');
$I->seeNodeChildren($div, array('a', 'div.carousel-caption'));
$a = $div->filter('a');
$I->seeNodeAttribute($a, 'href', '#');
break;
case 1:
$I->seeNodeChildren($div, array('img', 'div.carousel-caption'));
break;
case 2:
$img = $div->filter('img.image');
$I->seeNodeAttributes($img, array('src' => 'image.png', 'alt' => 'Alternative text'));
break;
}
}
}
示例3: foreach
<?php
foreach ($ads as $ad) {
$items[] = $ad->getAd();
}
echo TbHtml::carousel($items);
示例4: array
array('heading' => 'Media heading', 'content' => '...'),
)); ?></pre>
</section>
<!-- Carousel
================================================== -->
<section id="carousel">
<div class="page-header">
<h1>Carousel</h1>
</div>
<div class="bs-docs-example">
<?php
echo TbHtml::carousel(array(array('image' => 'holder.js/830x477', 'label' => 'First Thumbnail label', 'caption' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.'), array('image' => 'holder.js/830x477', 'label' => 'Second Thumbnail label', 'caption' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.'), array('image' => 'holder.js/830x477', 'label' => 'Third Thumbnail label', 'caption' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.')));
?>
</div>
<pre class="prettyprint linenums">
<?php echo TbHtml::carousel(array(
array('image' => 'holder.js/830x477', 'label' => 'First Thumbnail label', 'caption' => '...'),
array('image' => 'holder.js/830x477', 'label' => 'Second Thumbnail label', 'caption' => '...'),
array('image' => 'holder.js/830x477', 'label' => 'Third Thumbnail label', 'caption' => '...'),
)); ?></pre>
</section>
<!-- Miscellaneous
================================================== -->
示例5: array
<!-- Carousel
================================================== -->
<section id="carousel">
<div class="page-header">
<h1>Carousel</h1>
</div>
<h2>Example carousel</h2>
<p>The slideshow below shows a generic plugin and component for cycling through elements like a carousel.</p>
<div class="bs-docs-example">
<?php
echo TbHtml::carousel(array(array('content' => '<img src="holder.js/660x380" />', 'label' => 'First Thumbnail label', 'caption' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.'), array('content' => '<img src="holder.js/660x380" />', 'label' => 'Second Thumbnail label', 'caption' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.'), array('content' => '<img src="holder.js/660x380" />', 'label' => 'Third Thumbnail label', 'caption' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.')), array('style' => 'width: 660px;'));
?>
</div>
<pre class="prettyprint linenums">
<?php echo TbHtml::carousel(
array(
array(
'content' => '<img src="holder.js/660x380" />',
'label' => 'First Thumbnail label',
'caption' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. ...',
),
array(
'content' => '<img src="holder.js/660x380" />',
'label' => 'Second Thumbnail label',
'caption' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. ...',
),