本文整理汇总了PHP中yii\bootstrap\Modal::widget方法的典型用法代码示例。如果您正苦于以下问题:PHP Modal::widget方法的具体用法?PHP Modal::widget怎么用?PHP Modal::widget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\bootstrap\Modal
的用法示例。
在下文中一共展示了Modal::widget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
public static function widget($config = [])
{
$config = array_merge(['header' => '<span id="cjModalHeaderTitle"></span>', 'headerOptions' => ['id' => 'cjModalHeader'], 'id' => 'cjModal', 'size' => 'modal-lg', 'clientOptions' => ['backdrop' => 'static', 'keyboard' => FALSE], 'clientEvents' => ['hidden.bs.modal' => new JsExpression('function(){$(\'#cjModalContent\').html(\'<i class="fa fa-refresh fa-spin"></i>\');}')]], $config);
return parent::widget($config);
// $this->headerOptions = ['id' => 'modalHeader'];
// $this->id = 'modal';
// $this->size = 'modal-lg';
// //keeps from closing modal with esc key or by clicking out of the modal.
// // user must click cancel or X to close
// $this->clientOptions = ['backdrop' => 'static', 'keyboard' => FALSE];
}
示例2: run
/**
* Renders the widget.
*/
public function run()
{
$this->registerClientScript();
$button = Html::button(FontAwesome::icon('picture-o') . ' ' . $this->buttonLabel, $this->buttonOptions);
if ($this->iframe) {
$button .= Modal::widget(['id' => $this->getIFrameModalId(), 'header' => Html::tag('h4', $this->modalTitle, ['class' => 'modal-title']), 'size' => Modal::SIZE_LARGE, 'options' => ['class' => 'kcfinder-modal']]);
}
$thumbs = '';
if ($this->hasModel() && is_array($this->model->{$this->attribute})) {
$images = $this->model->{$this->attribute};
foreach ($images as $path) {
$thumbs .= strtr($this->thumbTemplate, ['{thumbSrc}' => $this->getThumbSrc($path), '{inputName}' => $this->getInputName(), '{inputValue}' => $path]);
}
}
$thumbs = Html::tag('ul', $thumbs, ['id' => $this->getThumbsId(), 'class' => 'kcf-thumbs']);
echo Html::tag('div', strtr($this->template, ['{button}' => $button, '{thumbs}' => $thumbs]), ['class' => 'kcf-input-group']);
}
示例3: JsExpression
echo $form->field($model, 'description')->widget(LangInputWidget::classname(), ['options' => ['type' => 'activeTextarea']]);
?>
<?php
echo $form->field($model, 'content')->widget(LangInputWidget::classname(), ['options' => ['type' => 'activeTextarea', 'redactor' => true, 'urlPreffix' => 'news/', 'form' => $form]]);
?>
</div>
<div class="tab-pane" id="tags-tab">
<?
$modalNewTag = Modal::widget([
'id' => 'new-tag-modal',
'toggleButton' => [
'label' => Yii::t('b/news/tag', 'Add new tag'),
'tag' => 'a',
'data-target' => '#new-tag-modal',
'href' => Url::toRoute(['tag/add-new-tag']),
],
'closeButton' => [
'tag' => 'button',
'label' => '<span aria-hidden="true">×</span>'
],
'clientOptions' => false,
]);
?>
<?php
echo $form->field($model, 'tagIds')->widget(SelectizeTextInput::className(), ['loadUrl' => ['tag/tags-list'], 'options' => ['class' => 'form-control'], 'clientOptions' => ['plugins' => ['remove_button', 'restore_on_backspace', 'drag_drop'], 'valueField' => 'id', 'labelField' => 'name', 'searchField' => ['name'], 'options' => new JsExpression($model->getTagItems()), 'items' => $model->getTagIds(true), 'hideSelected' => true, 'closeAfterSelect' => true]])->hint($modalNewTag);
?>
</div>
<div class="tab-pane" id="image-tab">
<?php
echo $form->field($model, 'image')->widget(FileInputWidget::classname(), ['options' => ['accept' => 'image/*'], 'pluginOptions' => ['initialPreview' => $model->getThumbFileUrl('image', 'small') ? [Html::img($model->getThumbFileUrl('image', 'small'), ['class' => 'file-preview-image'])] : []]]);
?>
示例4: array
<?php
/*
* 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.
*/
echo \yii\bootstrap\Modal::widget(['id' => "mailDialog", 'options' => array('title' => \Yii::t('app', 'Send Mail'), 'autoOpen' => false, 'width' => '600px')]);
?>
<?php
//\yii\bootstrap\Modal::end();
$script = "\nfunction getFile(url) {//only for docs\n //get file\n //post....\n \n var parms = \$('#docs-form').serializeArray();\n if(url!='')\n \$.post(url,parms,null,'json')\n .done(function(data) {\n console.log(data);\n if(data.status!=200){\n alert(data);\n }else{\n \$('#files').html('<i class=\"glyphicon glyphicon-paperclip\"></i> '+data.body.name);\n \$('#mail-files').val(data.body.id);\n }\n })\n .fail(function(data) {\n //alert(data.responseText);\n console.log(data);\n });\n\n\n\n //callback\n //show template\n\n //send mail\n\n }\n\n function getAddress() {//only for docs\n //get file\n //post....\n var url = '" . $urlAddress . "';\n var parms = {};//\$('#docs-form').serializeArray();\n \$.post(url, {},\n function(data) {\n console.log(data);\n \$('#mail-to').val(data.email);\n //callback\n //get template\n //doc,type\n\n }, 'json');\n\n //callback\n //show template\n\n //send mail\n\n }\n\n\n function getMailForm() {\n \$.post('" . $urlMailForm . "', {'minimal': 'true'},\n function(data) {\n var fileUrl = '" . $urlFile . "';\n var actionUrl = '" . $urlAction . "'; \n\n //console.log(data);\n \$('#mailDialog > div.modal-dialog > div.modal-content > div.modal-body').html(data);\n \n\n if(fileUrl!='')\n getFile(fileUrl);\n getTemplate('" . $obj . "', '" . $type . "', '" . $id . "');\n getAddress();\n if(actionUrl!='')\n getAction(actionUrl);\n\n\n\n //\$('#mail-body').tinymce({'language': 'en', 'plugins': ['advlist autolink lists link image charmap print preview hr anchor pagebreak', 'searchreplace visualblocks visualchars code fullscreen', 'insertdatetime media nonbreaking save table contextmenu directionality', 'template paste textcolor'], 'toolbar': 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media | forecolor backcolor', 'toolbar_items_size': 'small', 'image_advtab': true, 'relative_urls': false, 'spellchecker_languages': '+Русский=ru'});\n\n }, 'json');//\n\n }\n\n function getAction(url) {\n //get input name start action\n var elements = \$('[name^=Action]');\n var arr={};\n for (var i = 0; i < elements.length; i++) {\n arr[elements[i].name]=elements[i].value;\n //console.log(elements[i].value);\n }\n //console.log(arr);\n \$.post(url, arr,\n function(data) {\n //console.log(data)\n //return data;\n \$('#mail-body').val(\$('#mail-body').val()+data.body);\n }, 'json');//\n //return '';\n }\n\n function getTemplate(obj, type, id) {\n \$.post('" . $urlTemplate . "', {'MailTemplate': {'obj': obj, 'type': type, 'id': id}},\n function(data) {\n\n //console.log(data[0].subject);\n\n \$('#mail-from').val();\n \$('#mail-to').val();\n \$('#mail-cc').val(data[0].cc);\n \$('#mail-bcc').val(data[0].bcc);\n \$('#mail-subject').val(data[0].subject);\n \$('#mail-body').val(data[0].body);\n \n //getBody();\n getAction();\n \n\n }, 'json');//\n }\n\n function showMail() {\n //\$('#mailDialog').dialog();\n \$('#mailDialog').modal('show');\n getMailForm();\n \n\n return;\n }\n\n\n";
$this->registerJs($script, \yii\web\View::POS_HEAD);
示例5:
<?php
/* @var $this yii\web\View */
use yii\authclient\widgets\AuthChoice;
use yii\bootstrap\Modal;
?>
<?php
if (Yii::$app->user->isGuest) {
Yii::$app->user->setReturnUrl(Yii::$app->request->getUrl());
?>
<h4>
<?php
echo Modal::widget(['header' => 'Логин', 'toggleButton' => ['class' => 'btn-link', 'label' => 'Войти', 'onclick' => '$(this).next().find(".modal-body").load("/user/user/login");']]);
?>
|
<?php
echo Modal::widget(['header' => 'Регистрация', 'toggleButton' => ['class' => 'btn-link', 'label' => 'Зарегистрироваться', 'onclick' => '$(this).next().find(".modal-body").load("/user/user/signup");']]);
?>
</h4>
<?php
echo yii\authclient\widgets\AuthChoice::widget(['baseAuthUrl' => ['/user/auth/auth']]);
}
示例6:
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
// echo $this->render('_search', ['model' => $searchModel]);
?>
<p>
<?php
echo Html::a('Create Country', ['create'], ['class' => 'btn btn-success']);
?>
<?php
echo Html::a('Pop up to create Country', ['create-in-dialog', 'id' => '11'], ['title' => 'Add new country', 'data-toggle' => 'modal', 'data-target' => '#myModal', 'class' => 'btn btn-success button-open-modal']);
?>
</p>
<table id="list_records"><tr><td></td></tr></table>
<div id="perpage"></div>
</div>
<?php
echo Modal::widget(['header' => '<h4 class="modal-title">我的模态对话框</h4>', 'id' => 'myModal']);
$this->registerJs(<<<JSCONTENT
\$('.button-open-modal').click(function() {
\$('#myModal .modal-body').html('加载中');
\$('#myModal .modal-body').eq(0).load(this.href);
});
JSCONTENT
);
示例7: function
?>
<div class="global-test-view">
<?php
echo DetailView::widget(['model' => $model, 'mode' => 'view', 'bordered' => false, 'striped' => true, 'condensed' => true, 'responsive' => true, 'hover' => true, 'deleteOptions' => ['params' => ['id' => 1000, 'kvdelete' => true]], 'container' => ['id' => 'kv-demo'], 'attributes' => [['group' => true, 'label' => 'Identification Information', 'rowOptions' => ['class' => 'default']], ['columns' => [['attribute' => 'PARTNUMBER', 'label' => 'Part Number', 'valueColOptions' => ['style' => 'width:25%']], ['attribute' => 'UUTNAME', 'label' => 'UUT Name', 'format' => 'raw', 'value' => $model->UUTNAME, 'valueColOptions' => ['style' => 'width:25%']]]], ['columns' => [['attribute' => 'STATIONID', 'label' => 'Station ID', 'valueColOptions' => ['style' => 'width:25%']], ['attribute' => 'TESTMODE', 'label' => 'Test Mode', 'format' => 'raw', 'value' => $model->TESTMODE === 'Test' ? '<span class="label label-warning">' . $model->TESTMODE . '</span>' : '<span class="label label-danger">' . $model->TESTMODE . '</span>', 'valueColOptions' => ['style' => 'width:25%']]]], ['columns' => [['attribute' => 'FACILITY', 'label' => 'Facility', 'valueColOptions' => ['style' => 'width:25%']], ['attribute' => 'GLOBALRESULT', 'label' => 'Test Result', 'format' => 'raw', 'value' => $model->GLOBALRESULT === 'Pass' ? '<span class="label label-success">' . $model->GLOBALRESULT . '</span>' : ($model->GLOBALRESULT === 'Fail' ? '<span class="label label-danger">' . $model->GLOBALRESULT . '</span>' : '<span class="label label-warning">' . $model->GLOBALRESULT . '</span>'), 'valueColOptions' => ['style' => 'width:25%']]]], ['group' => true, 'label' => 'Test Details', 'rowOptions' => ['class' => 'default']], ['columns' => [['attribute' => 'TESTDATE', 'label' => 'Test Date', 'format' => 'date', 'type' => DetailView::INPUT_DATE, 'valueColOptions' => ['style' => 'width:30%']], ['attribute' => 'TIMESTART', 'label' => 'Test Start', 'format' => 'raw', 'value' => $model->TIMESTART, 'type' => DetailView::INPUT_SWITCH, 'valueColOptions' => ['style' => 'width:30%']]]], ['columns' => [['attribute' => 'TECHNAME', 'label' => 'Tech Name', 'format' => 'raw', 'value' => $model->TECHNAME, 'type' => DetailView::INPUT_SELECT2, 'valueColOptions' => ['style' => 'width:30%']], ['attribute' => 'TIMESTOP', 'label' => 'Test Stop', 'format' => 'raw', 'type' => DetailView::INPUT_SWITCH, 'value' => $model->TIMESTOP, 'valueColOptions' => ['style' => 'width:30%']]]], ['attribute' => 'VERSIONS', 'label' => 'ATP Versions', 'format' => 'raw', 'value' => '<span class="text-justify"><em>' . $model->VERSIONS . '</em></span>', 'options' => ['rows' => 4]]]]);
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'bootstrap' => true, 'containerOptions' => ['style' => 'overflow: auto'], 'headerRowOptions' => ['class' => 'kartik-sheet-style'], 'filterRowOptions' => ['class' => 'kartik-sheet-style'], 'pjax' => true, 'toolbar' => ['{export}'], 'export' => ['fontAwesome' => true], 'bordered' => false, 'striped' => true, 'condensed' => true, 'responsive' => true, 'hover' => true, 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => Html::tag('i', Html::encode(' S/N: ' . $model->SERIALNUMBER), ['class' => 'glyphicon glyphicon-list'])], 'persistResize' => false, 'responsive' => true, 'hover' => true, 'columns' => [['attribute' => 'TEST_ID', 'label' => '#', 'format' => 'raw'], 'TESTNAME', ['attribute' => 'MINRANGE', 'label' => 'Min', 'format' => 'raw'], 'RESULT', ['attribute' => 'MAXRANGE', 'label' => 'Max', 'format' => 'raw'], 'UNITS', ['attribute' => 'RESULT', 'value' => function ($model, $key, $index, $widget) {
$pass_or_fail = $model->TESTSTATUS;
if ($pass_or_fail == 'Fail') {
return "<span class='label label-danger'> " . $model->TESTSTATUS . '</span>';
} else {
if ($pass_or_fail == 'Error') {
return "<span class='label label-warning'> " . $model->TESTSTATUS . '</span>';
} else {
return "<span class='label label-success'> " . $model->TESTSTATUS . '</span>';
}
}
}, 'filterInputOptions' => ['placeholder' => 'Any result'], 'vAlign' => 'middle', 'format' => 'raw'], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view}', 'buttons' => ['view' => function ($url, $model) {
if ($model->GRAPH_ID != '0') {
return \yii\bootstrap\Modal::widget(['id' => 'showModalButton' . $model->GRAPH_ID, 'toggleButton' => ['label' => null, 'class' => 'glyphicon glyphicon-equalizer', 'tag' => 'a', 'data-toggle' => 'modal', 'data-target' => '#showModalButton' . $model->GRAPH_ID, 'href' => Url::toRoute(['/traces-list/view?id=' . $model->GRAPH_ID])], 'clientOptions' => false]);
} else {
return "";
}
}]]]]);
?>
</div>
示例8: function
<?php
echo \yii\helpers\Html::buttonInput($label, ['class' => 'btn btn-success', 'id' => $id . '-button']);
echo \yii\bootstrap\Modal::widget(['header' => $label, 'id' => "popover-" . $id]);
$java = <<<java
\$('#{$id}-button').bind('click',function() {
\$('#popover-{$id}').modal('show');
\$('#popover-{$id}').show();
\$.get(baseAddress+"{$ajax}",
function (data) {
\$('#popover-{$id} > div.modal-dialog > div.modal-content > div.modal-body').html(\$(data).find('{$selctor}'));
\$('{$selctor} > div > button:submit').replaceWith( "<a id='{$id}-submitButton' href='' class='btn btn-success'>Create</a>" );
}, "html");
});
java;
$this->registerJs($java, \yii\web\View::POS_READY);
$java = <<<java
\$(document).on("click","#{$id}-submitButton",function () {
var form = \$('{$selctor}').serialize()+"&ajax=true";
var url = \$('{$selctor}').attr('action');
\$.post(url, form,
function (data) {
if(data.status==200){
//hide.self
示例9:
<div class="apteki-update">
<?php
echo $this->render('_form', ['model' => $model, 'pi' => $pi, 'regional' => $regional, 'ur' => $ur]);
?>
<br>
</div>
</div>
<div class="col-md-4">
<div align="right" style="margin-right: 5%">
<?php
print \yii\bootstrap\Modal::widget(['id' => 'myModal4', 'toggleButton' => ['label' => 'Доступ к закрытому уровню сайта', 'tag' => 'a', 'data-target' => '#myModal4', 'href' => Url::toRoute(["/sbuser/update3/{$model->id}"]), 'class' => 'btn btn-info'], 'clientOptions' => false]);
?>
</div>
<?php
if ($model->coordinates) {
?>
<script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU&coordorder=longlat" type="text/javascript"></script>
<br><br><br><br>
<script type="text/javascript">
var moscow_map;
ymaps.ready(function () {
示例10: sprintf
if (!empty($data['present'])) {
$result .= '<br>' . Html::tag('small', sprintf(' > %s', $data['present']));
}
return $result;
}], ['attribute' => 'entity_id', 'options' => ['width' => '10%']], ['format' => 'raw', 'attribute' => 'changes', 'value' => function ($data) {
$content = Html::tag('div', VarDumper::dumpAsString(unserialize($data['changes']), 10, true), ['class' => 'content changes hidden', 'data-id' => $data['id']]);
return empty($data['changes']) ? null : Html::a(\Yii::t('app', 'show'), '#', ['data-role' => 'show-changes', 'data-id' => $data['id']]) . $content;
}, 'options' => ['width' => '7%']], ['format' => 'raw', 'attribute' => 'env', 'value' => function ($data) {
$content = Html::tag('div', VarDumper::dumpAsString(unserialize($data['env']), 10, true), ['class' => 'content env hidden', 'data-id' => $data['id']]);
return empty($data['env']) ? null : Html::a(\Yii::t('app', 'show'), '#', ['data-role' => 'show-env', 'data-id' => $data['id']]) . $content;
}, 'options' => ['width' => '7%']], ['attribute' => 'created_at', 'value' => function ($data) {
return Yii::$app->get('formatter')->asDatetime($data['created_at']);
}, 'options' => ['width' => '20%']]]]);
Pjax::end();
$this->registerJs('initializePopUps();');
echo Modal::widget(['id' => 'detail-content', 'header' => 'Detail information']);
?>
<script type="text/javascript">
function initializePopUps() {
var $modal = jQuery('#detail-content');
jQuery('body')
.on('click', '[data-role="show-changes"]', function (e) {
var $link = $(this);
$modal.find('.modal-body').html(jQuery('.content.changes[data-id="' + $link.data('id') + '"]').html());
$modal.modal('show');
e.preventDefault();
})
示例11: function
<div class="col-md-2">
<?php
echo \yii\jui\DatePicker::widget(['model' => $filterModel, 'attribute' => 'date_created_to', 'language' => 'ru', 'dateFormat' => 'yyyy-MM-dd']);
?>
</div>
<div class="col-md-3"></div>
<div class="col-md-2">
<?php
echo \yii\bootstrap\Button::widget(['label' => 'искать']);
echo Html::a('Добавить', Url::to(['books/create']), ['class' => 'btn btn-default']);
?>
</div>
</div>
<?php
echo \yii\grid\GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['id', 'title', ['attribute' => 'preview', 'format' => 'html', 'value' => function ($data) {
$image = Html::img($data->preview, ['height' => '50px', 'data-index' => $data->id, 'class' => 'modal_image']);
return $image;
}], 'authorName', 'date_created', 'date_added', ['class' => \yii\grid\ActionColumn::className(), 'template' => '{update} {view} {delete}', 'buttons' => ['view' => function ($url, $model, $key) {
$id = 'view_' . $model->id;
return \yii\bootstrap\Modal::widget(['id' => $id, 'toggleButton' => ['label' => '', 'tag' => 'a', 'href' => $url, 'data-target' => '#' . $id, 'class' => 'glyphicon glyphicon-eye-open']]);
}, 'update' => function ($url, $model, $key) use($getArray) {
return Html::a('', Url::to(['books/update', 'id' => $model->id, 'filtredModel' => $getArray]), ['class' => 'glyphicon glyphicon-pencil']);
}]]]]);
?>
<div id="modal_image_dialog" class="fade modal" role="dialog" tabindex="-1">
<div class="modal-dialog ">
<div class="modal-content">
<img id="modal_image_body">
</div>
</div>
</div>
示例12: foreach
}
if ($apteki_count == "") {
$apteki_count = 0;
}
$modal_apteki = \yii\bootstrap\Modal::widget(['id' => $modal_apteki_id, 'toggleButton' => ['label' => $apteki_count, 'tag' => 'a', 'data-target' => "#{$modal_apteki_id}", 'href' => Url::toRoute(["/vznos/modalapteki/?region_id={$region_id}®ional_id={$user_id}"]), 'class' => 'badge'], 'clientOptions' => false]);
print "<td align='center'>" . $modal_apteki . "</td>";
$id_ur_l = Vznos::getUr_l_in_region($user_id, $region_id);
$all_ur = ArrayHelper::getColumn($id_ur_l, 'id');
$oplatili = Vznos::Oplatalili($all_ur);
foreach ($kv = Vznos::getKvartals(null, 3) as $date) {
$array_date = $date['year'] . $date['kvartal'];
print "<td align='center'>";
$neOplatili = Vznos::NeOplatalili($all_ur, $oplatili, $region_id, $user_id, $date);
$count_n[$array_date] = $count_n[$array_date] + $neOplatili;
$nurl = implode(",", Vznos::$neoplatili_ur_l);
print \yii\bootstrap\Modal::widget(['id' => $modal_apteki_id, 'toggleButton' => ['label' => $neOplatili, 'tag' => 'a', 'data-target' => "#{$modal_apteki_id}", 'href' => Url::toRoute(["/vznos/modalneoplatili2/?ur_ls={$nurl}"]), 'class' => 'badge'], 'clientOptions' => false]);
print "</td>";
}
print "</tr>\n";
$c_a = $c_a + $apteki_count;
$c_u = $c_u + $ur_region['count'];
$c++;
}
}
//print "<td>". $uu."</td>";
// print "</tr>\n\n";
}
?>
<tr>
<td><h3>Всего:</h3></td>
示例13: function
?>
<div class="client-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::button('Create Client', ['class' => 'btn btn-success show-modal', 'value' => Url::to(['create']), 'data-target' => '#modal_view', 'data-header' => 'Create Client']);
?>
</p>
<?php
echo Modal::widget(['id' => 'modal_view']);
?>
<?php
Pjax::begin(['id' => 'pjax-client-index']);
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'client_id', 'redirect_uri:ntext', 'grant_type:ntext', 'scope:ntext', ['class' => 'yii\\grid\\ActionColumn', 'buttons' => ['view' => function ($url, $model, $key) {
$options = array_merge(['title' => Yii::t('yii', 'View'), 'aria-label' => Yii::t('yii', 'View'), 'data-pjax' => '0', 'class' => 'show-modal', 'value' => $url, 'data-target' => '#modal_view', 'data-header' => Yii::t('yii', 'View') . ' ' . 'Clients']);
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', 'javascript:;', $options);
}, 'update' => function ($url, $model, $key) {
$options = array_merge(['title' => Yii::t('yii', 'Update'), 'aria-label' => Yii::t('yii', 'Update'), 'data-pjax' => '0', 'class' => 'show-modal', 'value' => $url, 'data-target' => '#modal_view', 'data-header' => Yii::t('yii', 'Update') . ' ' . 'Clients']);
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', 'javascript:;', $options);
}]]]]);
?>
示例14: date
</div>
<footer>
<div class="container">
<hr>
<p class="copyright text-muted">
© <?php
echo Yii::$app->name . ' ' . date('Y');
?>
</p>
</div>
</footer>
<?php
echo Modal::widget(['clientOptions' => false, 'options' => ['id' => 'modal-form', 'tabindex' => false]]);
?>
<?php
echo Html::img(Url::to('@web/img/preloader.gif'), ['id' => 'preloader', 'style' => 'display: none']);
?>
<?php
$this->endBody();
?>
</body>
</html>
<?php
示例15: registerRelations
/**
* Registers JS code for handling relations.
* @param \yii\web\View $view
* @return string modal widget to be embedded in a view
*/
public static function registerRelations($view)
{
\netis\crud\assets\RelationsAsset::register($view);
$options = \yii\helpers\Json::htmlEncode(['i18n' => ['loadingText' => Yii::t('app', 'Loading, please wait.')], 'keysSeparator' => \netis\crud\crud\Action::KEYS_SEPARATOR, 'compositeKeySeparator' => \netis\crud\crud\Action::COMPOSITE_KEY_SEPARATOR]);
$view->registerJs("netis.init({$options})", \yii\web\View::POS_READY, 'netis.init');
// init relation tools used in _relations subview
// relations modal may contain a form and must be rendered outside ActiveForm
return \yii\bootstrap\Modal::widget(['id' => 'relationModal', 'size' => \yii\bootstrap\Modal::SIZE_LARGE, 'header' => '<span class="modal-title"></span>', 'footer' => implode('', [Html::button(Yii::t('app', 'Save'), ['id' => 'relationSave', 'class' => 'btn btn-primary']), Html::button(Yii::t('app', 'Cancel'), ['class' => 'btn btn-default', 'data-dismiss' => 'modal', 'aria-hidden' => 'true'])])]);
}