本文整理匯總了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. ...',
),