本文整理汇总了PHP中TbHtml::tabs方法的典型用法代码示例。如果您正苦于以下问题:PHP TbHtml::tabs方法的具体用法?PHP TbHtml::tabs怎么用?PHP TbHtml::tabs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TbHtml
的用法示例。
在下文中一共展示了TbHtml::tabs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testTabs
public function testTabs()
{
$I = $this->codeGuy;
$html = TbHtml::tabs(array(array('label' => 'Link', 'url' => '#')));
$nav = $I->createNode($html, 'ul.nav');
$I->seeNodeCssClass($nav, 'nav-tabs');
}
示例2: array
<a class="brand" href="/"><?php
echo CHtml::encode(Yii::app()->name);
?>
</a>
<div class="nav-collapse collapse">
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span9">
<?php
echo TbHtml::tabs(array(array('label' => 'Книги', 'url' => Yii::app()->createUrl('library/library/tabs', array('tab_id' => 'books')), 'active' => isset($_GET['tab_id']) && $_GET['tab_id'] == 'books' ? true : false), array('label' => 'Авторы', 'url' => Yii::app()->createUrl('library/library/tabs', array('tab_id' => 'authors')), 'active' => isset($_GET['tab_id']) && $_GET['tab_id'] == 'authors' ? true : false), array('label' => 'Читатели', 'url' => Yii::app()->createUrl('library/library/tabs', array('tab_id' => 'readers')), 'active' => isset($_GET['tab_id']) && $_GET['tab_id'] == 'readers' ? true : false), array('label' => 'Библиотека', 'url' => Yii::app()->createUrl('library/library/tabs', array('tab_id' => 'library')), 'active' => isset($_GET['tab_id']) && $_GET['tab_id'] == 'library' ? true : false), array('label' => 'Отчеты', 'url' => Yii::app()->createUrl('library/reports', array('tab_id' => 'report')), 'active' => isset($_GET['tab_id']) && $_GET['tab_id'] == 'report' ? true : false), array('label' => 'Поиск', 'url' => Yii::app()->createUrl('library/search', array('tab_id' => 'search')), 'active' => isset($_GET['tab_id']) && $_GET['tab_id'] == 'search' ? true : false)));
?>
<?php
echo $content;
?>
</div>
</div>
<hr>
<footer>
<p> © 2014 by Agilites. All rights reserved.</p>
</footer>
</div>
</body>
示例3: array
<?php echo TbHtml::stackedPills(array(
array('label' => 'Home', 'url' => '#', 'active' => true),
array('label' => 'Profile', 'url' => '#',),
array('label' => 'Messages', 'url' => '#',),
)); ?>
</pre>
<hr class="bs-docs-separator">
<h2>Dropdowns</h2>
<h3>Tabs with dropdowns</h3>
<div class="bs-docs-example">
<?php
echo TbHtml::tabs(array(array('label' => 'Home', 'url' => '#', 'active' => true), array('label' => 'Help', 'url' => '#'), array('label' => 'Dropdown', 'items' => $dropdownConfig)));
?>
</div>
<pre class="prettyprint linenums">
<?php echo TbHtml::tabs(array(
array('label' => 'Home', 'url' => '#', 'active' => true),
array('label' => 'Help', 'url' => '#'),
array('label' => 'Dropdown', 'items' => array(
array('label' => 'Action', 'url' => '#'),
array('label' => 'Another action', 'url' => '#'),
array('label' => 'Something else here', 'url' => '#'),
TbHtml::menuDivider(),
array('label' => 'Separate link', 'url' => '#'),
)),
)); ?>
示例4: tabbable
/**
* Generates a tabbable menu.
* @param array $tabs the tab configurations.
* @param array $htmlOptions additional HTML attributes.
* @return string the generated menu.
*/
public static function tabbable($tabs, $htmlOptions = array())
{
$htmlOptions = self::addClassName('tabbable', $htmlOptions);
$placement = self::popOption('placement', $htmlOptions);
if (!empty($placement)) {
$htmlOptions = self::addClassName('tabs-' . $placement, $htmlOptions);
}
$menuOptions = self::popOption('menuOptions', $htmlOptions, array());
$contentOptions = self::popOption('contentOptions', $htmlOptions, array());
$contentOptions = self::addClassName('tab-content', $contentOptions);
$menuItems = array();
foreach ($tabs as $i => &$tabOptions) {
$icon = self::popOption('icon', $tabOptions);
$label = self::popOption('label', $tabOptions, '');
$id = $tabOptions['id'] = self::popOption('id', $tabOptions, 'tab_' . ($i + 1));
$active = self::getOption('active', $tabOptions, false);
$disabled = self::popOption('disabled', $tabOptions, false);
$linkOptions = self::popOption('linkOptions', $tabOptions, array());
$linkOptions['data-toggle'] = 'tab';
$itemOptions = self::popOption('itemOptions', $tabOptions, array());
$items = self::popOption('items', $tabOptions, array());
$menuItem = array('icon' => $icon, 'label' => $label, 'url' => '#' . $id, 'active' => $active, 'disabled' => $disabled, 'itemOptions' => $itemOptions, 'linkOptions' => $linkOptions, 'items' => $items);
$menuItems[] = $menuItem;
}
ob_start();
echo TbHtml::openTag('div', $htmlOptions);
echo TbHtml::tabs($menuItems, $menuOptions);
echo TbHtml::openTag('div', $contentOptions);
foreach ($tabs as &$tabOptions) {
if (self::popOption('active', $tabOptions, false)) {
$tabOptions = self::addClassName('active', $tabOptions);
}
$tabContent = self::popOption('content', $tabOptions, '');
$tabOptions = self::addClassName('tab-pane', $tabOptions);
echo TbHtml::tag('div', $tabOptions, $tabContent);
}
echo '</div></div>';
return ob_get_clean();
}
示例5:
<?php
echo TbHtml::tabs(MenuItem::model()->findByPk($id)->getItems());