本文整理汇总了PHP中BsHtml::tag方法的典型用法代码示例。如果您正苦于以下问题:PHP BsHtml::tag方法的具体用法?PHP BsHtml::tag怎么用?PHP BsHtml::tag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BsHtml
的用法示例。
在下文中一共展示了BsHtml::tag方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderButtons
/**
* Renders the buttons in this form.
* @return string the rendering result.
*/
public function renderButtons()
{
$buttons = array();
foreach ($this->getButtons() as $button) {
$buttons[] = $this->renderElement($button);
}
return !empty($buttons) ? BsHtml::tag('div', array('class' => 'form-actions'), implode("\n", $buttons)) : '';
}
示例2: run
public function run()
{
$type = $this->type;
echo BsHtml::openTag('div', array('id' => $this->id));
/*** Nav tabs ***/
echo BsHtml::$type($this->_labels);
/*** Tab panes ***/
echo BsHtml::openTag('div', array('class' => 'tab-content'));
foreach ($this->_content as $content) {
$class = 'tab-pane' . ($content['active'] == true ? ' active' : '');
echo BsHtml::tag('div', array('class' => $class, 'id' => $content['id'], 'role' => 'tabpanel'), $content['content']);
}
echo BsHtml::closeTag('div');
echo BsHtml::closeTag('div');
/*** clientScript ***/
$cs = Yii::app()->getClientScript();
$navs = '
$("#' . $this->id . ' ul.nav a").on("click",function(e){
e.preventDefault();
$(this).tab("show");
})
';
$cs->registerScript("navs-" . $this->id, $navs);
}
示例3: array
<?php
/* @var $this SurveyController */
/* @var $simplePage SimplePage */
/* @var $dataProvider MultiLocatedSurveysDataProvider */
$columns = array(array("name" => "Название проекта", 'type' => 'raw', 'value' => '$data->title'), array("name" => "Aнкета", 'type' => 'raw', 'value' => '\'<a href="\'.Yii::app()->createUrl(\'survey/view\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" target="_blank">Открыть</a>\''), array('class' => "QuotasInfoDataColumn", 'quotaType' => 'limit', "name" => "Требуется анкет"), array("name" => "Сделано анкет", 'class' => "QuotasInfoDataColumn", 'quotaType' => 'totalCount', 'needLink' => true, 'needShowQuotaType' => 'limit'), array("name" => "Массив данных в SPSS", 'type' => 'raw', 'value' => '\'<a href="\'.Yii::app()->createUrl(\'survey/exportSPSSStructure\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" target="_blank">Скачать синтаксис</a>
<br/>
<a href="\'.Yii::app()->createUrl(\'survey/exportSPSSData\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" target="_blank">Скачать данные</a>\''), array("name" => "Массив данных в Excel", 'type' => 'raw', 'value' => '\'<a href="\'.Yii::app()->createUrl(\'survey/exportExcel\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" target="_blank">Скачать</a>\''), array("name" => "Быстрая аналитика", 'type' => 'raw', 'value' => '\'<a href="\'.Yii::app()->createUrl(\'survey/quickAnalytics\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" target="_blank">Открыть</a>\''), array("name" => "Полная аналитика", 'class' => 'DownloadFilesColumn', 'fileType' => AttachedFile::FILE_TYPE_FULL_ANALYTICS, 'nullValue' => array('value' => '\'<a href="\'.Yii::app()->createUrl(\'survey/orderAnalytics\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" class="offer-analytics" target="_blank">Не предусмотрено, заказать</a>\'', 'type' => 'raw'), 'linkValue' => 'Посмотреть структуру будущего отчёта'));
if (Yii::app()->user->checkAccess('survey.edit')) {
$columns[] = array('name' => '', 'type' => 'raw', 'value' => '\'<a class="update" data-title="Редактировать" title="" data-toggle="tooltip" href="\'.Yii::app()->createUrl(\'survey/update\', array(\'id\' => $data->sid, \'location\' => $data->location)).\'" data-original-title="Редактировать">
<span class="glyphicon glyphicon-pencil"></span>
</a>\'', 'htmlOptions' => array('class' => 'button-column'));
}
?>
<?php
if ($simplePage) {
echo '<h1>' . $simplePage->title . '</h1>';
echo BsHtml::tag('div', array('class' => 'page-text'), $simplePage->content);
} else {
echo '<h1>Активные проекты</h1>';
}
$this->widget('bootstrap.widgets.BsGridView', array('id' => 'surveys-grid', 'dataProvider' => $dataProvider, 'columns' => $columns));
示例4: renderEmptyText
/**
* Renders the empty message when there is no data.
*/
public function renderEmptyText()
{
$emptyText = $this->emptyText === null ? Yii::t('zii', 'No results found.') : $this->emptyText;
echo BsHtml::tag('div', array('class' => 'empty col-md-12'), $emptyText);
}
示例5: run
/**
* Runs the widget.
*/
public function run()
{
$brand = $this->brandLabel !== false ? BsHtml::navbarBrandLink($this->brandLabel, $this->brandUrl, $this->brandOptions) : '';
ob_start();
foreach ($this->items as $item) {
if (is_string($item)) {
echo $item;
} else {
$widgetClassName = BsArray::popValue('class', $item);
if ($widgetClassName !== null) {
$this->controller->widget($widgetClassName, $item);
}
}
}
$items = ob_get_clean();
ob_start();
if ($this->collapse !== false) {
BsHtml::addCssClass('collapse navbar-collapse', $this->collapseOptions);
ob_start();
/* @var BsCollapse $collapseWidget */
$collapseWidget = $this->controller->widget('bootstrap.widgets.BsCollapse', array('toggle' => false, 'content' => $items, 'htmlOptions' => $this->collapseOptions));
$collapseContent = ob_get_clean();
$collapseLink = BsHtml::navbarCollapseLink('#' . $collapseWidget->getId());
echo BsHtml::tag('div', array('class' => 'navbar-header'), $collapseLink . $brand) . $collapseContent;
} else {
echo BsHtml::tag('div', array('class' => 'navbar-header'), $brand) . $items;
}
$containerContent = ob_get_clean();
if (isset($this->position) && ($this->position === BsHtml::NAVBAR_POSITION_FIXED_TOP || $this->position === BsHtml::NAVBAR_POSITION_STATIC_TOP)) {
$fluid = BsArray::popValue('containerOptions', $this->htmlOptions, false);
$containerOptions = BsArray::popValue('containerOptions', $this->htmlOptions, array());
$containerClass = 'container';
if ($fluid) {
$containerOptions = BsArray::removeValue('fluid', $this->htmlOptions, array());
$containerClass = 'container-fluid';
}
BsHtml::addCssClass($containerClass, $containerOptions);
$content = BsHtml::tag('div', $containerOptions, $containerContent);
echo BsHtml::navbar($content, $this->htmlOptions);
return;
}
echo BsHtml::navbar($containerContent, $this->htmlOptions);
}
示例6: renderDecoration
/**
* Renders the decoration for the portlet.
* The default implementation will render the title if it is set.
*/
protected function renderDecoration()
{
if ($this->title !== null) {
echo "<div class=\"{$this->decorationCssClass}\">\n";
echo ($this->titleTag ? BsHtml::tag($this->titleTag, array('class' => $this->titleCssClass), $this->title) : $this->title) . "\n";
echo "</div>\n";
}
}
示例7: renderModalHeader
/**
* Renders the header HTML markup of the modal
*/
public function renderModalHeader()
{
echo '<div class="modal-header">' . PHP_EOL;
if ($this->closeText) {
echo BsHtml::closeButton($this->closeText, array('data-dismiss' => 'modal'));
}
echo BsHtml::tag('h3', array(), $this->header);
echo '</div>' . PHP_EOL;
}