本文整理汇总了PHP中kartik\helpers\Html::button方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::button方法的具体用法?PHP Html::button怎么用?PHP Html::button使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kartik\helpers\Html
的用法示例。
在下文中一共展示了Html::button方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run()
{
parent::run();
$wid = $this->options['id'];
echo Html::activeHiddenInput($this->model, $this->attribute);
echo Html::beginTag('div', ['id' => $wid . '-buttons', 'class' => 'input-group btn-group']);
$items = PublishBehavior::getPublishedOptions();
$colors = PublishBehavior::getPublishedColors();
foreach ($items as $key => $item) {
echo Html::button($item, ['data' => ['value' => $key], 'class' => $key == $this->model->{$this->attribute} ? 'btn btn-' . $colors[$key] . ' active' : 'btn btn-default']);
}
echo Html::endTag('div');
$js_colors = Json::encode($colors);
$js = <<<JS
\$('#{$wid}-buttons').find('button').each(function(){
\$(this).on('click',function(){
\$('#{$wid}-buttons').find('button').each(function(){
\$(this).removeClass('btn-danger btn-warning btn-success btn-info active');
\$(this).addClass('btn-default');
});
var color={$js_colors};
\$(this).removeClass('btn-default');
\$(this).addClass('btn-'+color[\$(this).data('value')]+' active');
\$('#{$wid}').val(\$(this).data('value'))
});
});
JS;
$this->view->registerJs($js);
}
示例2:
use yii\bootstrap\Tabs;
$this->title = Yii::t('app', 'Rbac');
$this->params['breadcrumbs'][] = $this->title;
$this->beginBlock('buttonGroup');
?>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group">
<?php
echo Html::a(Yii::t('app', 'Create Permission'), ['create', 'returnUrl' => \app\backend\components\Helper::getReturnUrl(), 'type' => \yii\rbac\Item::TYPE_PERMISSION], ['class' => 'btn btn-success']);
?>
<?php
echo Html::a(Yii::t('app', 'Create Role'), ['create', 'returnUrl' => \app\backend\components\Helper::getReturnUrl(), 'type' => \yii\rbac\Item::TYPE_ROLE], ['class' => 'btn btn-success']);
?>
</div>
<?php
echo Html::button(Yii::t('app', 'Delete selected'), ['class' => 'btn btn-danger', 'id' => 'deleteItems']);
?>
</div>
<?php
$this->endBlock();
?>
<div class="user-index">
<?php
BackendWidget::begin(['icon' => 'lock', 'title' => $this->title, 'footer' => $this->blocks['buttonGroup']]);
?>
<?php
echo Tabs::widget(['items' => [['label' => Yii::t('app', 'Permissions'), 'content' => $this->render('_rbacGrid', ['data' => $permissions, 'isRules' => $isRules, 'id' => 'operations']), 'active' => true], ['label' => Yii::t('app', 'Roles'), 'content' => $this->render('_rbacGrid', ['data' => $roles, 'isRules' => $isRules, 'id' => 'roles'])]]]);
?>
<?php
BackendWidget::end();
?>
示例3:
<?php
use kartik\helpers\Html;
use frontend\widgets\Alert;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
if (\Yii::$app->session->hasFlash('success')) {
$preBody = Alert::widget();
} else {
$preBody = NULL;
}
$btnAuth = Html::button('<i class="fa fa-plus"></i> Autorisierung hinzufügen', ['class' => 'btn btn-warning btn-xs pull-right', 'id' => 'btn-newauth']);
$btnLic = Html::button('<i class="fa fa-plus"></i> Lizenz hinzufügen', ['class' => 'btn btn-warning btn-xs pull-right', 'id' => 'btn-newlic']);
echo Html::panel(['heading' => " " . $btnLic . $btnAuth, 'preBody' => $preBody, 'body' => $this->render('_usersform', ['model' => $model])], 'default', ['id' => 'detail-panel']);
示例4:
?>
<section id="widget-grid">
<div class="row">
<article class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<?php
BackendWidget::begin(['title' => Yii::t('app', 'Common'), 'icon' => 'pencil', 'footer' => $this->blocks['submit']]);
?>
<?php
echo $form->field($model, 'name');
?>
<?php
echo $form->field($model, 'view', ['addon' => ['append' => ['content' => Html::button(Icon::show('folder-open-o'), ['class' => 'btn btn-primary', 'id' => 'show-tree']), 'asButton' => true]]]);
?>
<?php
echo $form->field($model, 'category');
?>
<?php
echo $form->field($model, 'internal_name');
?>
<?php
BackendWidget::end();
?>
</article>
<article class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
示例5: init
public function init()
{
if (is_array($this->copyFrom)) {
$id = Html::getInputId($this->model, $this->attribute);
$buttonId = $id . '-copyButton';
$this->addon['append'] = ['content' => Html::button(Icon::show('code'), ['class' => 'btn btn-primary', 'id' => $buttonId]), 'asButton' => true];
$encodedFrom = Json::encode($this->copyFrom);
$encodedTo = Json::encode('#' . $id);
$js = <<<EOT
\$("#{$buttonId}").click(function(){
Admin.copyFrom(
{$encodedFrom},
{$encodedTo}
);
});
EOT;
$this->form->getView()->registerJs($js);
} elseif (is_array($this->makeSlug)) {
$id = Html::getInputId($this->model, $this->attribute);
$buttonId = $id . '-slugButton';
$this->addon['append'] = ['content' => Html::button(Icon::show('code'), ['class' => 'btn btn-primary', 'id' => $buttonId]), 'asButton' => true];
$encodedFrom = Json::encode($this->makeSlug);
$encodedTo = Json::encode('#' . $id);
$js = <<<EOT
\$("#{$buttonId}").click(function(){
Admin.makeSlug(
{$encodedFrom},
{$encodedTo}
);
});
EOT;
$this->form->getView()->registerJs($js);
}
parent::init();
}
示例6: statusIssue
function statusIssue($model)
{
if ($model->STATUS == 1) {
/*REVIEW*/
// return Html::a('<i class="fa fa-square-o fa-md"></i> REVIEW','#',['class'=>'btn btn-info btn-xs', 'style'=>['width'=>'100px'],'title'=>'Review']);
return Html::button(Yii::t('app', 'Review'), ['value' => url::to(['link-berita', 'id' => $model->ID]), 'id' => 'modal-btn-issue', 'class' => "btn btn-info btn-xs", 'style' => ['width' => '100px']]);
} elseif ($model->STATUS == 2) {
/*PROCESS*/
return Html::a('<i class="fa fa-check-square-o fa-md"></i> OPEN', url::toRoute(['/widget/berita/detail-berita-open', 'id' => $model->ID_ISSUE_REF]), ['class' => 'btn btn-success btn-xs', 'style' => ['width' => '100px'], 'title' => 'Process']);
} elseif ($model->STATUS == 3) {
/*CLODED*/
return Html::a('<i class="glyphicon glyphicon-remove"></i> CLOSED', url::toRoute(['/widget/berita/detail-berita-open', 'id' => $model->ID_ISSUE_REF]), ['class' => 'btn btn-danger btn-xs', 'style' => ['width' => '100px'], 'title' => 'Closed']);
}
}
示例7: function
return StarRating::widget(['name' => 'rating_1']);
}], ['attribute' => 'ACTUAL_DATE1', 'filterType' => GridView::FILTER_DATE], ['attribute' => 'ACTUAL_DATE2', 'filterType' => GridView::FILTER_DATE], ['label' => 'Discription', 'attribute' => 'DSCRP', 'mergeHeader' => true, 'value' => function ($model, $key, $index, $widget) {
if ($model->DSCRP != '') {
return substr($model->DSCRP, 0, 30) . ' ...';
//Author -ptr.nov- limit disply text
} else {
return '';
}
}], ['label' => 'Status', 'attribute' => 'STATUS', 'format' => 'html', 'hAlign' => 'center', 'value' => function ($model) {
if ($model->STATUS == 0) {
return Html::a('<i class="fa fa-edit"></i> Open', '', ['class' => 'btn btn-success btn-sm', 'title' => 'Open']);
} else {
if ($model->STATUS == 1) {
return Html::a('<i class="fa fa-close"></i> Close', '', ['class' => 'btn btn-danger btn-sm', 'title' => 'Closing']);
}
}
}, 'filter' => ['0' => 'Open', '1' => 'Close']], ['class' => 'yii\\grid\\ActionColumn', 'header' => 'Action']], 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'gv-pilot']], 'toolbar' => [['content' => Html::button('<i class="glyphicon glyphicon-plus"></i>', ['type' => 'button', '', 'class' => 'btn btn-success', 'onclick' => 'alert("This will launch the book creation form.\\n\\nDisabled for this demo!");']) . ' ' . Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['grid-demo'], ['data-pjax' => 0, 'class' => 'btn btn-default', ''])], '{export}', '{toggleData}'], 'panel' => ['type' => 'info', 'heading' => 'Pilot Project'], 'hover' => true, 'responsive' => true, 'bordered' => true, 'striped' => true, 'autoXlFormat' => true, 'export' => ['fontAwesome' => true, 'showConfirmAlert' => false]]);
/* AUTHOR -ptr.nov- Render ID GANTT PILOT PROJECT*/
$dsp = '
<div class="row">
<div class="col-sm-12" id="chart-container">FusionCharts will render here</div>
</div>
';
/* AUTHOR -ptr.nov- ITEM TABs */
$items = [['label' => '<i class="glyphicon glyphicon-home"></i> Pilot Schedule Data', 'content' => $gv_pilot], ['label' => '<i class="glyphicon glyphicon-home"></i> Pilot Schedule Preview', 'content' => $dsp]];
/* AUTHOR -ptr.nov- TAB Widget*/
echo TabsX::widget(['items' => $items, 'position' => TabsX::POS_ABOVE, 'bordered' => true, 'encodeLabels' => false]);
?>
示例8:
?>
<?php
echo $form->field($model, 'status')->dropDownList($model->getStatusValues());
?>
<?php
echo $form->field($model, 'created_at')->textInput(['value' => $model->createdAtStr]);
?>
<?php
echo $form->field($model, 'updated_at')->textInput(['value' => $model->updatedAtStr, 'disabled' => $model->isNewRecord ? false : true]);
?>
<?php
echo $form->field($model, 'role')->dropDownList($model->getRoleValues());
?>
</div>
</div>
<?php
echo $this->render('_authform', ['form' => $form, 'model' => $model]);
?>
<div class="row">
<div class="col-md-12">
<?php
echo Html::button('<i class="fa fa-save"></i> Benutzer speichern', ['type' => 'submit', 'class' => 'btn btn-default', 'style' => "width:100%;", 'encodeLabels' => false]);
?>
</div>
</div>
<?php
ActiveForm::end();
?>
</div>
示例9: function
'font-size'=>'8pt',
'background-color'=>'rgba(249, 215, 100, 1)',
]
],
'contentOptions'=>[
'style'=>[
'text-align'=>'center',
'font-family'=>'tahoma, arial, sans-serif',
'font-size'=>'8pt',
//'background-color'=>'rgba(13, 127, 3, 0.1)',
]
],
];
*/
$btn_srch = Html::a('<i class="fa fa-search"></i> Search Date', '/master/review-visit/ambil-tanggal', ['data-toggle' => "modal", 'data-target' => "#modal-tgl", 'class' => 'btn btn-info btn-sm']);
$btn_srchReviewDetail = Html::button(Yii::t('app', 'Search Date'), ['value' => url::to(['ambil-tanggal']), 'id' => 'modalButtonReviewTgl', 'class' => "btn btn-info btn-sm"]);
/*SHOW GRID VIEW LIST*/
$indexReviewDetail = GridView::widget(['id' => 'cust-visit-list', 'dataProvider' => $dataProviderHeader1, 'filterModel' => $searchModelHeader1, 'columns' => $attDinamik, 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'cust-visit-list']], 'summary' => false, 'panel' => ['heading' => '<div style="float:left;margin-right:10px" class="fa fa-2x fa-bicycle"></div><div><h4 class="modal-title">DAILY REVIEW CUSTOMER CALL</h4></div>' . ' ' . '<div style="float:right; margin-top:-22px;margin-right:0px;">' . $btn_srchReviewDetail . '</div>', 'type' => 'success'], 'toolbar' => ['']]);
?>
<?php
echo $indexReviewDetail;
?>
<?php
$this->registerJs("\t\t\n\t\t\$.fn.modal.Constructor.prototype.enforceFocus = function(){};\t\n\t\t\$(document).on('click','#modalButtonReviewTgl', function(ehead){ \t\t\t \n\t\t\t\$('#modal-review-tgl').modal('show')\n\t\t\t.find('#modalContentReviewTgl')\n\t\t\t.load(ehead.target.value);\n\t\t});\t\t \n\t\t\t \n\t", $this::POS_READY);
Modal::begin(['id' => 'modal-review-tgl', 'header' => '<div style="float:left;margin-right:10px" class="fa fa-2x fa-search"></div><div><h4 class="modal-title"> SEARCH DATE</h4></div>', 'size' => Modal::SIZE_SMALL, 'headerOptions' => ['style' => 'border-radius:5px; background-color: rgba(90, 171, 255, 0.7)']]);
echo "<div id='modalContentReviewTgl'></div>";
Modal::end();
//$("#msline-salesmd-visit").updateFusionCharts({dataSource: 'jsonURL', dataFormat: 'MyNewChart.json’});
?>
示例10:
?>
</div>
</div>
</div>
<div class="col-md-6 text-center">
<div class="panel panel-default">
<div class="panel-body">
<?php
echo Html::label('Which file will use for layout?:');
?>
<?php
echo Html::dropDownList('file', null, $fileList, ['class' => 'form-control']);
?>
</div>
<div class="panel-footer"><?php
echo Html::button('Next', ['class' => 'btn btn-success NextButton']);
?>
</div>
</div>
</div>
</div>
<?php
echo Html::input('hidden', 'headerselector', $headerSelector);
?>
<?php
echo Html::input('hidden', 'contentselector', $contentSelector);
?>
<?php
echo Html::input('hidden', 'footerselector', $footerSelector);
?>
<?php
示例11: function
AdminAsset::register($this);
?>
<div class="page-header">
<div class="pull-right"><?php
echo AdminMenu::widget(['ui' => 'list', 'user' => null]);
?>
</div>
<h1><?php
echo $this->title;
?>
</h1>
</div>
<div id="batch-status-out"></div>
<div style="width:200px;float:right;margin:-10px auto;">
<?php
echo Select2::widget(['name' => 'batch-status', 'value' => '', 'data' => $m->getValidStatuses(), 'addon' => ['append' => ['content' => Html::button(Html::icon('saved'), ['class' => 'btn btn-default', 'id' => 'btn-batch-update', 'title' => Yii::t('user', 'Go!')]), 'asButton' => true]], 'options' => ['id' => 'batch-status', 'placeholder' => Yii::t('user', 'Batch update...')]]);
?>
</div>
<div class="clearfix"></div>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => true, 'panel' => false, 'export' => false, 'options' => ['id' => 'user-grid'], 'columns' => [['attribute' => 'id', 'width' => '80px'], ['attribute' => 'username', 'width' => '120px', 'format' => 'raw', 'content' => function ($model) {
return $model->getUserLink();
}], 'email:email', ['attribute' => 'status', 'format' => 'raw', 'hAlign' => 'center', 'content' => function ($model) {
return $model->getStatusHtml();
}, 'filter' => $m->getPrimaryStatuses(), 'width' => '140px', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['options' => ['placeholder' => Yii::t('user', 'Select...')], 'pluginOptions' => ['allowClear' => true]]], ['attribute' => 'status_sec', 'format' => 'raw', 'hAlign' => 'center', 'content' => function ($model) {
return $model->getStatusSecHtml();
}, 'filter' => $m->getSecondaryStatuses(), 'width' => '140px', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['options' => ['placeholder' => Yii::t('user', 'Select...')], 'pluginOptions' => ['allowClear' => true]]], ['attribute' => 'last_login_ip', 'format' => 'raw', 'hAlign' => 'center', 'width' => '130px', 'value' => function ($model) {
return $model->last_login_ip ? '<samp>' . $model->last_login_ip . '</samp>' : null;
}], ['attribute' => 'last_login_on', 'format' => ['datetime', $m->datetimeDispFormat], 'hAlign' => 'center', 'filter' => false, 'mergeHeader' => true, 'value' => function ($model) {
return Module::displayAttrTime($model, 'last_login_on');
}], ['attribute' => 'created_on', 'hAlign' => 'center', 'format' => 'date', 'label' => Yii::t('user', 'Member Since'), 'filter' => false, 'mergeHeader' => true], ['class' => 'kartik\\grid\\CheckboxColumn', 'checkboxOptions' => function ($model) {
示例12:
use yii\widgets\ActiveForm;
use kartik\detail\DetailView;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
//use kartik\editable\Editable;
use kartik\grid\GridView;
use kartik\tabs\TabsX;
use kartik\money\MaskMoney;
use ptrnov\fusionchart\Chart;
use lukisongroup\assets\Profile;
Profile::register($this);
use lukisongroup\assets\AppAssetDahboardDatamaster;
AppAssetDahboardDatamaster::register($this);
use ptrnov\fusionchart\ChartAsset;
ChartAsset::register($this);
$btn_srchData = Html::button(Yii::t('app', 'Search Data'), ['value' => url::to(['ambil-monthly']), 'id' => 'modal-button-monthly-id', 'class' => "btn btn-info btn-sm"]);
$mslineCustomerVisit = Chart::Widget(['urlSource' => url::base() . '/dashboard/rpt-esm-chart-salesmd/visit-per-sales?id=56', 'userid' => 'piter@lukison.com', 'dataArray' => '[]', 'dataField' => '[]', 'type' => 'msline', 'renderid' => 'msline-monthly-salesmd-visit', 'autoRender' => true, 'width' => '100%', 'height' => '500%', 'chartOption' => ['caption' => 'Daily Customers Visits', 'subCaption' => 'Custommer Call, Active Customer, Efictif Customer', 'xaxisName' => 'Parents', 'yaxisName' => 'Total Child ', 'theme' => 'fint', 'is2D' => "0", 'showValues' => "1", 'palettecolors' => "#583e78,#008ee4,#f8bd19,#e44a00,#6baa01,#ff2e2e", 'bgColor' => "#ffffff", 'showBorder' => "0", 'showCanvasBorder' => "0"]]);
print_r('asd' . $test);
?>
<div class="container-fluid w3-content pale-blue" style="max-width:1400px;max-height:1400px;margin-top:10px;font-family: verdana, arial, sans-serif ;font-size: 8pt">
<!-- The Grid -->
<div class="row">
<!-- Left Column -->
<div class="col-lg-3">
<!-- Profile -->
<div class="w3-card-2 w3-round w3-pale-blue">
<div class="w3-container">
<h4 class="w3-center">My Profile</h4>
示例13: rgba
// }
// },
Modal::begin(['headerOptions' => ['id' => 'modalHeader'], 'id' => 'modal', 'size' => 'modal-sm']);
echo "<div id='modalContent'></div>";
Modal::end();
/*modal*/
Modal::begin(['id' => 'modal-view_cus-crm', 'header' => '<div style="float:left;margin-right:10px" class="fa fa-user"></div><div><h5 class="modal-title"><b>VIEW User</b></h5></div>', 'size' => Modal::SIZE_LARGE, 'headerOptions' => ['style' => 'border-radius:5px; background-color: rgba(74, 206, 231, 1)']]);
echo "<div id='modalContentcrm'></div>";
Modal::end();
/*
* GRIDVIEW USER LIST : author wawan
*/
$gvUser = GridView::widget(['id' => 'gv-user-list-id', 'dataProvider' => $dataProviderUser, 'filterModel' => $searchModelUser, 'filterRowOptions' => ['style' => 'background-color:rgba(97, 211, 96, 0.3); align:center'], 'rowOptions' => function ($model, $key, $index, $grid) {
return ['id' => $model->id, 'onclick' => 'detail(this,' . $model->id . '); return false;'];
}, 'columns' => [['class' => 'kartik\\grid\\SerialColumn', 'width' => '10px', 'header' => 'No.', 'hAlign' => 'center', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma', 'font-size' => '8pt']], 'pageSummaryOptions' => ['style' => ['border-right' => '0px']]], ['attribute' => 'username', 'label' => 'User', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '100px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '100px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'POSITION_SITE', 'label' => 'Site Login', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '100px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '100px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['attribute' => 'POSITION_LOGIN', 'label' => 'Position Login', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '100px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '100px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => true, 'template' => '{view}', 'dropdownOptions' => ['class' => 'pull-right dropup'], 'dropdownButton' => ['class' => 'btn btn-default btn-xs'], 'buttons' => ['view' => function ($url, $model, $key) {
return Html::button(Yii::t('app', 'View User Crm'), ['value' => url::to(['view-user-crm', 'id' => $model->id]), 'id' => 'modalButtoncrm', 'class' => "btn btn-default btn-xs", 'style' => ['width' => '170px', 'height' => '25px', 'border' => 'none']]);
}], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'height' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']]]], 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'gv-user-list-id']], 'panel' => ['heading' => '<h3 class="panel-title">USER LIST</h3>', 'type' => 'warning', 'before' => Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Yii::t('app', 'Add User ', ['modelClass' => 'Kategori']), '/master/schedule-header/create-user', ['data-toggle' => "modal", 'data-target' => "#modal-create", 'class' => 'btn btn-success']), 'showFooter' => false], 'toolbar' => [], 'hover' => true, 'responsive' => true, 'responsiveWrap' => true, 'bordered' => true, 'striped' => '4px', 'autoXlFormat' => true, 'export' => false]);
/*
* GRIDVIEW USER LIST : author wawan
*/
// $info=GridView::widget([
// 'id'=>'gv-user-id',
// 'dataProvider' => $dataProvider1,
// // 'filterModel' => $searchModelUser,
// 'filterRowOptions'=>['style'=>'background-color:rgba(97, 211, 96, 0.3); align:center'],
// 'columns' => [
// [ //COL-0
// /* Attribute Serial No */
// 'class'=>'kartik\grid\SerialColumn',
// 'width'=>'10px',
// 'header'=>'No.',
示例14:
<?php
use kartik\helpers\Html;
use yii\helpers\Url;
use yii\helpers\Json;
use yii\web\Response;
use yii\helpers\ArrayHelper;
use yii\web\Request;
use yii\bootstrap\Modal;
use ptrnov\fusionchart\Chart;
use ptrnov\fusionchart\ChartAsset;
ChartAsset::register($this);
$btn_srchChart = Html::button(Yii::t('app', 'Search Date'), ['value' => url::to(['ambil-tanggal-chart']), 'id' => 'modalButtonChartTgl', 'class' => "btn btn-info btn-sm"]);
$mslineCustomerVisit = Chart::Widget(['urlSource' => url::base() . '/dashboard/rpt-esm-chart-salesmd/visit', 'userid' => 'piter@lukison.com', 'dataArray' => '[]', 'dataField' => '[]', 'type' => 'msline', 'renderid' => 'msline-salesmd-visit', 'autoRender' => true, 'width' => '100%', 'height' => '500%', 'chartOption' => ['caption' => 'Daily Customers Visits', 'subCaption' => 'Custommer Call, Active Customer, Efictif Customer', 'xaxisName' => 'Parents', 'yaxisName' => 'Total Child ', 'theme' => 'fint', 'is2D' => "0", 'showValues' => "1", 'palettecolors' => "#583e78,#008ee4,#f8bd19,#e44a00,#6baa01,#ff2e2e", 'bgColor' => "#ffffff", 'showBorder' => "0", 'showCanvasBorder' => "0"]]);
$mslineCustomerVisitStock = Chart::Widget(['urlSource' => url::base() . '/dashboard/rpt-esm-chart-salesmd/visit-stock', 'userid' => 'piter@lukison.com', 'dataArray' => '[]', 'dataField' => '[]', 'type' => 'mscolumn3d', 'renderid' => 'msline-salesmd-visit-stock', 'autoRender' => true, 'width' => '100%', 'height' => '500%', 'chartOption' => ['caption' => 'Daily Customers Visits', 'subCaption' => 'Custommer Call, Active Customer, Efictif Customer', 'xaxisName' => 'Parents', 'yaxisName' => 'Total Child ', 'theme' => 'fint', 'is2D' => "0", 'showValues' => "1", 'palettecolors' => "#583e78,#008ee4,#f8bd19,#e44a00,#6baa01,#ff2e2e", 'bgColor' => "#ffffff", 'showBorder' => "0", 'showCanvasBorder' => "0"]]);
$mslineCustomerVisitRequest = Chart::Widget(['urlSource' => url::base() . '/dashboard/rpt-esm-chart-salesmd/visit-request', 'userid' => 'piter@lukison.com', 'dataArray' => '[]', 'dataField' => '[]', 'type' => 'mscolumn3d', 'renderid' => 'msline-salesmd-visit-request', 'autoRender' => true, 'width' => '100%', 'height' => '500%', 'chartOption' => ['caption' => 'Daily Customers Visits', 'subCaption' => 'Custommer Call, Active Customer, Efictif Customer', 'xaxisName' => 'Parents', 'yaxisName' => 'Total Child ', 'theme' => 'fint', 'is2D' => "0", 'showValues' => "1", 'palettecolors' => "#583e78,#008ee4,#f8bd19,#e44a00,#6baa01,#ff2e2e", 'bgColor' => "#ffffff", 'showBorder' => "0", 'showCanvasBorder' => "0"]]);
$mslineCustomerVisitSellout = Chart::Widget(['urlSource' => url::base() . '/dashboard/rpt-esm-chart-salesmd/visit-sellout', 'userid' => 'piter@lukison.com', 'dataArray' => '[]', 'dataField' => '[]', 'type' => 'mscolumn3d', 'renderid' => 'msline-salesmd-visit-sellout', 'autoRender' => true, 'width' => '100%', 'height' => '500%', 'chartOption' => ['caption' => 'Daily Customers Visits', 'subCaption' => 'Custommer Call, Active Customer, Efictif Customer', 'xaxisName' => 'Parents', 'yaxisName' => 'Total Child ', 'theme' => 'fint', 'is2D' => "0", 'showValues' => "1", 'palettecolors' => "#583e78,#008ee4,#f8bd19,#e44a00,#6baa01,#ff2e2e", 'bgColor' => "#ffffff", 'showBorder' => "0", 'showCanvasBorder' => "0"]]);
?>
<div class="container-fluid" style="font-family: verdana, arial, sans-serif ;font-size: 8pt; padding-top:-150px">
<div class="col-xs-12 col-sm-12 col-dm-12 col-lg-12">
<div class="row" style="padding-bottom:10px" >
<?php
echo $btn_srchChart;
?>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-dm-12 col-lg-12">
<div class="row" >
示例15: function
<?php
use kartik\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
$btnTest = Html::button('Dokumente publizieren', ['class' => 'btn btn-warning btn-xs pull-right', 'id' => 'btn-publish']);
echo Html::panel(['heading' => 'Summary' . $btnTest, 'headingTitle' => true, 'body' => GridView::widget(['dataProvider' => $model, 'summary' => "<div class='summary'><i class=\"fa fa-cloud-upload\"></i> {begin}-{end} von {totalCount} Dokumente können publiziert werden</div>", 'pager' => ['options' => ['class' => 'pagination pagination-sm']], 'columns' => ['cb' => ['class' => 'yii\\grid\\CheckboxColumn', 'options' => ['style' => 'width:20px;'], 'multiple' => false], 'filename' => ['label' => 'Dateiname', 'attribute' => 'filename', 'value' => 'filenamePlain'], 'Title' => ['label' => 'Titel', 'attribute' => 'Titel'], 'f' => ['label' => 'Bearbeitet durch:', 'attribute' => 'updated_by', 'options' => ['style' => 'width:140px;']], 'updated_at' => ['label' => 'Bearbeitet am:', 'attribute' => 'updated_at', 'value' => 'de_updated_at', 'options' => ['style' => 'width:100px;']], 'status' => ['label' => 'akt. Status', 'attribute' => 'onlineStatus', 'value' => 'onlineStatus_str', 'options' => ['style' => 'width:80px;'], 'contentOptions' => ['style' => 'text-align:center;'], 'format' => 'raw'], ['class' => 'yii\\grid\\ActionColumn', 'content' => 'foo', 'template' => '{edit}', 'filterOptions' => ['style' => 'text-align:right;'], 'contentOptions' => ['style' => 'text-align:right;width:45px;'], 'buttons' => ['edit' => function ($url, $model, $key) {
return Html::a("<i class='fa fa-pencil'></i>", $url, ['data-class' => 'edit']);
}]]]]), 'footer' => false], 'default', ['style' => 'font-size:12px;', 'id' => 'publish-grid']);
// Publish Modal rendern (hidden) ----------------------------------------------
echo $this->render('_publishModal');
//
// HereDoc Syntax (nach <<< Name darf kein Zeichen sein) -----------------------
$js = <<<JS
\$(document).on('ready pjax:complete',function(){
\tvar html = \$('div.grid-view .summary').html();
\tvar btn = \$('#publish-grid .panel-title button');
\t\$('#publish-grid .panel-title').html(html).append(btn);\t
});
\$(document).on('click','#btn-publish',function(){
\t\$('#publish-modal').modal();
});
JS;
$this->registerJs($js);
// Verkleinern der Filterfelder und ausblenden der Summary ---------------------
$css = <<<CSS
.summary{
\tdisplay:none;\t
}
CSS;
$this->registerCss($css);