當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TbHtml::carousel方法代碼示例

本文整理匯總了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/>
開發者ID:coderay1100,項目名稱:morena,代碼行數:10,代碼來源:index.php

示例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;
         }
     }
 }
開發者ID:AlexanderGrant1,項目名稱:AC41004,代碼行數:30,代碼來源:TbHtmlTest.php

示例3: foreach

<?php

foreach ($ads as $ad) {
    $items[] = $ad->getAd();
}
echo TbHtml::carousel($items);
開發者ID:jackycgq,項目名稱:advanced,代碼行數:6,代碼來源:ad.php

示例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">
&lt;?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
    ================================================== -->
開發者ID:crisu83,項目名稱:yiistrap-docs,代碼行數:31,代碼來源:components.php

示例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">
&lt;?php echo TbHtml::carousel(
    array(
        array(
            'content' =&gt; '&lt;img src=&quot;holder.js/660x380&quot; /&gt;',
            'label'   =&gt; 'First Thumbnail label',
            'caption' =&gt; 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. ...',
        ),
        array(
            'content' =&gt; '&lt;img src=&quot;holder.js/660x380&quot; /&gt;',
            'label'   =&gt; 'Second Thumbnail label',
            'caption' =&gt; 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. ...',
        ),
開發者ID:yii-twbs,項目名稱:yiistrap-docs,代碼行數:29,代碼來源:javascript.php


注:本文中的TbHtml::carousel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。