当前位置: 首页>>代码示例>>PHP>>正文


PHP Modal::begin方法代码示例

本文整理汇总了PHP中yii\bootstrap\Modal::begin方法的典型用法代码示例。如果您正苦于以下问题:PHP Modal::begin方法的具体用法?PHP Modal::begin怎么用?PHP Modal::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\bootstrap\Modal的用法示例。


在下文中一共展示了Modal::begin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

    /**
     * Runs the widget.
     */
    public function run()
    {
        // Print elfinder widget in modal
        Modal::begin(['toggleButton' => false, 'id' => $this->options['id'] . '-dialog', 'size' => Modal::SIZE_LARGE]);
        echo ElFinder::widget(['language' => $this->language, 'controller' => $this->controller, 'path' => $this->path, 'filter' => 'image', 'callbackFunction' => new JsExpression('function(file, id){

                console.log( file.url, "' . $this->buttonOptions['id'] . '" );

                $("#' . $this->options['id'] . '").val( file.url );
                $("#' . $this->options['id'] . '-thumb").attr("src", file.url ).show();
                $("#' . $this->options['id'] . '-dialog").modal("hide");

            }'), 'path' => $this->path, 'frameOptions' => ['style' => 'width: 100%; height: 500px; border: 0px;']]);
        Modal::end();
        // Render input and upload button
        if ($this->hasModel()) {
            $attr = $this->attribute;
            $hidden = $this->model->{$attr} ? '' : 'display:none;';
            $replace['{image}'] = '<img id="' . $this->options['id'] . '-thumb" class="thumbnail" src="' . $this->model->{$attr} . '" style="max-width: 150px; max-height: 150px; ' . $hidden . '" />';
            $replace['{input}'] = Html::activeTextInput($this->model, $this->attribute, $this->options);
        } else {
            $hidden = $this->value ? '' : 'display:none;';
            $replace['{image}'] = '<img id="' . $this->options['id'] . '-thumb" src="' . $this->value . '"  style="max-width: 150px; max-height: 150px; ' . $hidden . '" />';
            $replace['{input}'] = Html::textInput($this->name, $this->value, $this->options);
        }
        $replace['{button}'] = Html::tag($this->buttonTag, $this->buttonName, $this->buttonOptions);
        echo strtr($this->template, $replace);
        // Publish assets
        AssetsCallBack::register($this->getView());
        if (!empty($this->multiple)) {
            $this->getView()->registerJs("\n\n            mihaildev.elFinder.register(" . Json::encode($this->options['id']) . ",\n                function(files, id){\n                    var _f = [];\n                    for (var i in files) { _f.push(files[i].url); }\n                    \$('#' + id).val(_f.join(', ')).trigger('change');\n                    return true;\n                });\n\n            \$(document).on('click','#" . $this->buttonOptions['id'] . "',\n                function(){\n                    mihaildev.elFinder.openManager(" . Json::encode($this->_managerOptions) . ");\n                }\n            );");
        } else {
            $this->getView()->registerJs("\n\n                mihaildev.elFinder.register(" . Json::encode($this->options['id']) . ", function(file, id){\n                    \$('#' + id).val(file.url).trigger('change');\n                    return true;\n                });\n\n                \$(document).on('click',\n                    '#" . $this->buttonOptions['id'] . "',\n                    function(){\n                        //mihaildev.elFinder.openManager(" . Json::encode($this->_managerOptions) . ");\n                        \$('#" . $this->options['id'] . "-dialog').modal('show');\n                    }\n                );");
        }
    }
开发者ID:kibercoder,项目名称:bilious-octo-fibula,代码行数:38,代码来源:InputFile.php

示例2: run

 public function run()
 {
     if (is_null($this->imageOptions)) {
         $this->imageOptions = ['class' => 'img-responsive'];
     }
     $this->imageOptions['id'] = Yii::$app->getSecurity()->generateRandomString(10);
     $inputField = Html::getInputId($this->model, $this->attribute);
     $class = \yii\helpers\StringHelper::basename(get_class($this->model)) . 'Cutter';
     echo Html::beginTag('div', ['class' => 'image-cutter', 'id' => $inputField . '-cutter']);
     echo Html::activeFileInput($this->model, $this->attribute);
     echo Html::hiddenInput($class . '[' . $this->attribute . ']', $this->model->{$this->attribute});
     $previewImage = Html::beginTag('div', ['class' => 'img-container']);
     $previewImage .= Html::tag('span', '', ['class' => 'helper']);
     $previewImage .= Html::tag('span', Yii::t('sadovojav/cutter/cutter', 'Click to upload image'), ['class' => 'message']);
     $previewImage .= Html::img($this->model->{$this->attribute} ? $this->model->{$this->attribute} : null, ['class' => 'preview-image']);
     $previewImage .= Html::endTag('div');
     echo Html::label($previewImage, Html::getInputId($this->model, $this->attribute), ['class' => 'dropzone']);
     echo Html::checkbox($class . '[' . $this->attribute . '-remove]', false, ['label' => Yii::t('sadovojav/cutter/cutter', 'Remove')]);
     Modal::begin(['header' => Html::tag('h4', Yii::t('sadovojav/cutter/cutter', 'Cutter'), ['class' => 'modal-title']), 'closeButton' => false, 'footer' => $this->getModalFooter($inputField), 'size' => Modal::SIZE_LARGE]);
     echo Html::beginTag('div', ['class' => 'image-container']);
     echo Html::img(null, $this->imageOptions);
     echo Html::endTag('div');
     echo Html::tag('br');
     echo Html::beginTag('div', ['class' => 'row']);
     echo Html::beginTag('div', ['class' => 'col-md-2']);
     echo Html::label(Yii::t('sadovojav/cutter/cutter', 'Aspect ratio'), $inputField . '-aspectRatio');
     echo Html::textInput($class . '[' . $this->attribute . '-aspectRatio]', isset($this->cropperOptions['aspectRatio']) ? $this->cropperOptions['aspectRatio'] : 0, ['id' => $inputField . '-aspectRatio', 'class' => 'form-control']);
     echo Html::endTag('div');
     echo Html::beginTag('div', ['class' => 'col-md-2']);
     echo Html::label(Yii::t('sadovojav/cutter/cutter', 'Angle'), $inputField . '-dataRotate');
     echo Html::textInput($class . '[' . $this->attribute . '-cropping][dataRotate]', '', ['id' => $inputField . '-dataRotate', 'class' => 'form-control']);
     echo Html::endTag('div');
     echo Html::beginTag('div', ['class' => 'col-md-2']);
     echo Html::label(Yii::t('sadovojav/cutter/cutter', 'Position') . ' (x)', $inputField . '-dataX');
     echo Html::textInput($class . '[' . $this->attribute . '-cropping][dataX]', '', ['id' => $inputField . '-dataX', 'class' => 'form-control']);
     echo Html::endTag('div');
     echo Html::beginTag('div', ['class' => 'col-md-2']);
     echo Html::label(Yii::t('sadovojav/cutter/cutter', 'Position') . ' (y)', $inputField . '-dataY');
     echo Html::textInput($class . '[' . $this->attribute . '-cropping][dataY]', '', ['id' => $inputField . '-dataY', 'class' => 'form-control']);
     echo Html::endTag('div');
     echo Html::beginTag('div', ['class' => 'col-md-2']);
     echo Html::label(Yii::t('sadovojav/cutter/cutter', 'Width'), $inputField . '-dataWidth');
     echo Html::textInput($class . '[' . $this->attribute . '-cropping][dataWidth]', '', ['id' => $inputField . '-dataWidth', 'class' => 'form-control']);
     echo Html::endTag('div');
     echo Html::beginTag('div', ['class' => 'col-md-2']);
     echo Html::label(Yii::t('sadovojav/cutter/cutter', 'Height'), $inputField . '-dataHeight');
     echo Html::textInput($class . '[' . $this->attribute . '-cropping][dataHeight]', '', ['id' => $inputField . '-dataHeight', 'class' => 'form-control']);
     echo Html::endTag('div');
     echo Html::endTag('div');
     Modal::end();
     echo Html::endTag('div');
     $options = ['inputField' => $inputField, 'useWindowHeight' => $this->useWindowHeight, 'cropperOptions' => $this->cropperOptions];
     $options = Json::encode($options);
     $this->view->registerJs('jQuery("#' . $inputField . '").cutter(' . $options . ');');
 }
开发者ID:sadovojav,项目名称:yii2-image-cutter,代码行数:55,代码来源:Cutter.php

示例3: initializeModal

    private function initializeModal(){

        Modal::begin([
            'id' => 'activity-modal',
            'size' => $this->size,
            'header' => '<h2>'. $this->modelTitle .'</h2>',
            'footer' => Html::button('Close', ['class' => 'btn btn-info', 'data-dismiss' => 'modal']),
        ]);

        Modal::end();

//        Modal::begin([
//            'id' => 'activity-delete-modal',
//            'header' => '<h2>'. $this->deleteModelTitle .'</h2>',
//            'footer' => Html::button('Close', ['class' => 'btn btn-default', 'data-dismiss' => 'modal'])
//                . PHP_EOL . Html::button('Delete', [
//                    'class' => 'btn btn-primary btn-modal-save',
//                    'id' => 'delete-role-model',
//                    'data-id' => '',
//                    'onClick' => new JsExpression('var id=$("#delete-role-model").attr("data-id");$.ajax({type:"'. $this->deleteVerb .'",url:"'.$this->deleteUrl.'",data:{id:id},success:function(){$.pjax.reload({container:"#'. $this->pjaxContainerId .'",timeout:2e3}),$("#activity-delete-modal").modal("hide")}});')
//                ]),
//        ]);
//        echo 'Are You Sure To Delete This Item';
//        Modal::end();

    }
开发者ID:harish-reglobbe,项目名称:Auction,代码行数:26,代码来源:ModelCrud.php

示例4: run_iframe

 /**
  * iframe modal 框架模态弹出窗
  */
 private function run_iframe()
 {
     \Yii::$app->view->on(View::EVENT_END_BODY, function () {
         Modal::begin(['id' => 'iframeModal', 'header' => '<h4 class="modal-title"> Header </h4>', 'footer' => '<a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>', 'size' => Modal::SIZE_LARGE]);
         echo '<iframe ></iframe>';
         Modal::end();
     });
     $this->ifram_jscode();
 }
开发者ID:xiaohongyang,项目名称:yii_shop,代码行数:12,代码来源:ModalWidget.php

示例5: run

 public function run()
 {
     if (is_null($this->imageOptions)) {
         $this->imageOptions = ['class' => 'img-responsive'];
     }
     $this->imageOptions['id'] = Yii::$app->getSecurity()->generateRandomString(10);
     $inputField = Html::getInputId($this->model, $this->attribute);
     echo Html::beginTag('div', ['id' => $inputField . '-cutter']);
     echo Html::activeFileInput($this->model, $this->attribute, ['class' => 'hide']);
     echo Html::beginTag('div', ['class' => 'preview-pane', 'style' => $this->model->{$this->attribute} ? 'display:block' : 'display:none']);
     echo Html::beginTag('div', ['class' => 'preview-container']);
     echo Html::img($this->previewImgSrc ? $this->previewImgSrc : $this->model->{$this->attribute}, ['class' => 'preview-image ' . $this->previewImgClass]);
     echo Html::endTag('div');
     echo Html::endTag('div');
     echo Html::checkbox($this->attribute . '-remove', false, ['label' => Yii::t('davfervaz/cutter', 'Remove photo')]);
     Modal::begin(['header' => Html::tag('h4', Yii::t('davfervaz/cutter', 'Select the cut area')), 'closeButton' => [], 'footer' => $this->getModalFooter($inputField), 'size' => Modal::SIZE_LARGE]);
     echo Html::beginTag('div', ['class' => 'image-container']);
     echo Html::img(null, $this->imageOptions);
     echo Html::endTag('div');
     echo Html::tag('br');
     echo Html::beginTag('div', ['class' => 'row']);
     echo Html::beginTag('div', ['class' => 'col-md-2']);
     echo Html::label(Yii::t('davfervaz/cutter', 'ASPECT_RATIO'), $inputField . '-aspectRatio');
     echo Html::textInput($this->attribute . '-aspectRatio', isset($this->cropperOptions['aspectRatio']) ? $this->cropperOptions['aspectRatio'] : 0, ['id' => $inputField . '-aspectRatio', 'class' => 'form-control']);
     echo Html::endTag('div');
     echo Html::beginTag('div', ['class' => 'col-md-2']);
     echo Html::label(Yii::t('davfervaz/cutter', 'ANGLE'), $inputField . '-dataRotate');
     echo Html::textInput($this->attribute . '-cropping[dataRotate]', '', ['id' => $inputField . '-dataRotate', 'class' => 'form-control']);
     echo Html::endTag('div');
     echo Html::beginTag('div', ['class' => 'col-md-2']);
     echo Html::label(Yii::t('davfervaz/cutter', 'POSITION') . ' (X)', $inputField . '-dataX');
     echo Html::textInput($this->attribute . '-cropping[dataX]', '', ['id' => $inputField . '-dataX', 'class' => 'form-control']);
     echo Html::endTag('div');
     echo Html::beginTag('div', ['class' => 'col-md-2']);
     echo Html::label(Yii::t('davfervaz/cutter', 'POSITION') . ' (Y)', $inputField . '-dataY');
     echo Html::textInput($this->attribute . '-cropping[dataY]', '', ['id' => $inputField . '-dataY', 'class' => 'form-control']);
     echo Html::endTag('div');
     echo Html::beginTag('div', ['class' => 'col-md-2']);
     echo Html::label(Yii::t('davfervaz/cutter', 'WIDTH'), $inputField . '-dataWidth');
     echo Html::textInput($this->attribute . '-cropping[dataWidth]', '', ['id' => $inputField . '-dataWidth', 'class' => 'form-control']);
     echo Html::endTag('div');
     echo Html::beginTag('div', ['class' => 'col-md-2']);
     echo Html::label(Yii::t('davfervaz/cutter', 'HEIGHT'), $inputField . '-dataHeight');
     echo Html::textInput($this->attribute . '-cropping[dataHeight]', '', ['id' => $inputField . '-dataHeight', 'class' => 'form-control']);
     echo Html::endTag('div');
     echo Html::endTag('div');
     Modal::end();
     echo Html::endTag('div');
     $view = $this->getView();
     CutterAsset::register($view);
     $options = ['inputField' => $inputField, 'useWindowHeight' => $this->useWindowHeight, 'cropperOptions' => $this->cropperOptions];
     $options = Json::encode($options);
     $view->registerJs('jQuery("#' . $inputField . '").cutter(' . $options . ');');
 }
开发者ID:davfervaz,项目名称:yii2-image-cutter,代码行数:54,代码来源:Cutter.php

示例6: genModal

 private function genModal()
 {
     $forceOptions = ['size' => Modal::SIZE_LARGE];
     $modal = Modal::begin(array_merge($this->modalOptions, $forceOptions));
     if ($this->fieldID !== null && $this->returnType === null) {
         $this->returnType = self::RETURN_TYPE_URL;
     }
     $url = Url::to([$this->browserUrl, 'fieldID' => $this->fieldID, 'returnType' => $this->returnType, 'modalID' => $modal->id, 'subDir' => $this->options['subDir'], 'createDir' => $this->options['createDir'], 'changeDir' => $this->options['changeDir'], 'upload' => $this->options['upload']]);
     echo '<iframe src="' . $url . '" frameborder="0" style="height:80vh;width:100%"></iframe>';
     Modal::end();
 }
开发者ID:miragesoft,项目名称:yii2-basicfilemanager,代码行数:11,代码来源:ModalBrowser.php

示例7: run

 public function run()
 {
     $params = [];
     $footer = $this->getButtons();
     if ($footer) {
         $params['footer'] = $footer;
     }
     if ($this->title) {
         $params['header'] = '<h4>' . Html::encode($this->title) . '</h4>';
     }
     //~ if($this->updateModal) {
     //~ $params['options']['data-update-modal'] = Url::to($this->updateModal);
     //~ }
     BaseModal::begin($params);
     echo $this->content;
     BaseModal::end();
 }
开发者ID:uworkru,项目名称:yii2-base,代码行数:17,代码来源:Modal.php

示例8: run

 public function run()
 {
     $object = Object::getForClass(\app\models\Form::className());
     $groups = PropertyGroup::getForModel($object->id, $this->formId);
     $view = !empty($this->model->form_view) ? $this->model->form_view : 'form';
     $successView = !empty($this->model->form_success_view) ? $this->model->form_success_view : 'success';
     if (!$this->isModal) {
         echo Html::beginTag('div', ['id' => 'form-info-' . $this->id, 'style' => 'display: none;']);
         echo $this->render($successView);
         echo '</div>';
     }
     echo $this->render($view, ['id' => $this->id, 'model' => $this->model, 'groups' => $groups, 'options' => $this->options]);
     if ($this->isModal) {
         Modal::end();
         Modal::begin(['id' => 'modal-form-info-' . $this->id, 'size' => Modal::SIZE_SMALL, 'header' => $this->statusHeaderName ? $this->statusHeaderName : $this->model->name . ' ' . \Yii::t('app', 'status')]);
         echo $this->render($successView);
         Modal::end();
     }
 }
开发者ID:IliaP,项目名称:dotplant2,代码行数:19,代码来源:Form.php

示例9: run

 public function run()
 {
     echo Html::activeHiddenInput($this->model, $this->attribute, $this->options);
     $input_id = $this->attribute;
     if ($this->model[$this->attribute]) {
         $label = (new Category())->getAnchorPath($this->model[$this->attribute]);
     } else {
         $label = 'Выберете категорию';
     }
     Modal::begin(['header' => null, 'toggleButton' => ['label' => $label, 'class' => 'btn-link category-link-select', 'id' => 'btn-categories-modal'], 'options' => ['id' => 'categories-modal', 'data-input-id' => strtolower($this->model->formName()) . '-' . $input_id, 'data-categories-id' => $this->pluginOptions['categories_id']]]);
     echo Html::beginTag('div', ['class' => 'category-list', 'id' => 'category-list']);
     //        echo Html::beginTag('ul', ['class' => 'list-inline', 'id' => 'categories-lists']);
     //        echo '<li id="category-list-1"></li>';
     //        echo Html::endTag('ul');
     echo Html::endTag('div');
     Modal::end();
     //echo Html::a('Выберете категорию', null, ['id' => 'category-link-select']);
     $view = $this->view;
     CategoryAsset::register($view);
 }
开发者ID:mark38,项目名称:yii2-tor,代码行数:20,代码来源:CategoryLinkSelect.php

示例10: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     //assert view file is set
     if ($this->view === null) {
         $msg = Yii::t('app', 'Please set a view file');
         throw new InvalidConfigException($msg);
     }
     //default config
     if (empty($this->sections)) {
         $this->sections = ['Server' => 'server', 'Yii' => 'yii', 'Database' => 'db', 'Localization' => 'localization', 'Caching' => 'caching', 'RBAC' => 'rbac', 'Current User' => 'currentuser'];
     }
     //get php info
     $this->loadPhpInfo();
     //get modal code
     ob_start();
     Modal::begin(['id' => '{id}', 'header' => '<h4>{title}</h4>', 'size' => Modal::SIZE_LARGE]);
     echo '{content}';
     Modal::end();
     $this->modalCode = ob_get_clean();
 }
开发者ID:highestgoodlikewater,项目名称:yii2-toolbox,代码行数:24,代码来源:DebugAction.php

示例11: init

 public function init()
 {
     echo Html::beginTag('div', ['id' => $this->id]);
     $footer = "";
     if ($this->buttons !== null) {
         foreach ($this->buttons as $button) {
             $options = array_key_exists('options', $button) ? $button['options'] : [];
             if (in_array('submit', $button)) {
                 $options['data-submit'] = 1;
             }
             if (array_key_exists('action', $button)) {
                 $options['data-action'] = $button['action'];
             }
             $footer .= Html::button($button['content'], $options);
         }
     }
     $footer .= Html::button('Закрыть', ['class' => 'btn btn-default']);
     $this->modalOptions['footer'] = $footer;
     Modal::begin($this->modalOptions);
     parent::init();
 }
开发者ID:shubnikofff,项目名称:mobiles,代码行数:21,代码来源:ModalView.php

示例12: run

 /**
  * Renders the field.
  */
 public function run()
 {
     if (is_null($this->imageOptions)) {
         $this->imageOptions = ['alt' => 'Crop this image'];
     }
     $this->imageOptions['id'] = Yii::$app->getSecurity()->generateRandomString(10);
     $inputField = Html::getInputId($this->model, $this->attribute, ['data-image_id' => $this->imageOptions['id']]);
     $default_jcropOptions = ['dashed' => FALSE, 'zoomable' => FALSE, 'rotatable' => FALSE];
     $this->jcropOptions = array_merge($default_jcropOptions, $this->jcropOptions);
     if (is_null($this->form)) {
         $this->form = new ActiveForm();
         if (!is_null($this->enableClientValidation)) {
             $this->form->enableClientValidation = $this->enableClientValidation;
         }
     }
     echo Html::beginTag('div', ['class' => 'uploadcrop']);
     echo $this->form->field($this->model, $this->attribute)->fileInput();
     echo Html::beginTag('div', ['id' => 'preview-pane']);
     echo Html::beginTag('div', ['class' => 'preview-container']);
     echo Html::img('', ['class' => 'preview_image']);
     echo Html::endTag('div');
     echo Html::endTag('div');
     Modal::begin(['header' => '<h2>Crop image</h2>', 'closeButton' => [], 'footer' => Html::button('Cancel', ['id' => $this->imageOptions['id'] . '_button_cancel', 'class' => 'btn btn-default']) . Html::button('Accept', ['id' => $this->imageOptions['id'] . '_button_accept', 'class' => 'btn btn-success']), 'size' => Modal::SIZE_LARGE]);
     echo Html::beginTag('div', ['id' => 'image-source', 'class' => 'col-centered']);
     echo Html::img('', $this->imageOptions);
     echo Html::endTag('div');
     echo html::hiddenInput($this->attribute . '-cropping[x]', '', ['id' => $inputField . '-x']);
     echo html::hiddenInput($this->attribute . '-cropping[width]', '', ['id' => $inputField . '-width']);
     echo html::hiddenInput($this->attribute . '-cropping[y]', '', ['id' => $inputField . '-y']);
     echo html::hiddenInput($this->attribute . '-cropping[height]', '', ['id' => $inputField . '-height']);
     Modal::end();
     echo Html::endTag('div');
     $view = $this->getView();
     UploadCropAsset::register($view);
     $jcropOptions = ['inputField' => $inputField, 'jcropOptions' => $this->jcropOptions];
     $jcropOptions['maxSize'] = $this->maxSize;
     $jcropOptions = Json::encode($jcropOptions);
     $view->registerJs('jQuery("#' . $inputField . '").uploadCrop(' . $jcropOptions . ');');
 }
开发者ID:Zuzzancs,项目名称:yii2-widget-upload-crop,代码行数:42,代码来源:UploadCrop.php

示例13: widgetSendMessageModal

    /**
     * @param $view View
     * @return string
     * @throws \Exception
     */
    public static function widgetSendMessageModal(&$view)
    {
        $view->registerJs("messageurl = '" . Url::to(['/users/send-message'], true) . "';");
        ob_start();
        Modal::begin(['header' => '<h3>' . Yii::t('app', 'Send Message') . '</h3>', 'id' => 'messagemodal', 'size' => 'modal-md', 'closeButton' => ['label' => '', 'class' => 'close glyphicon glyphicon-remove'], 'options' => ['tabindex' => false], 'footer' => '<button type="button" class="btn btn-default pull-right" data-dismiss="modal">' . Yii::t('app', 'Cancel') . '</button>' . '<button  type="button" class="btn btn-primary pull-left" id="sendBtn">' . Yii::t('app', 'Send') . '</button>']);
        $url = \yii\helpers\Url::to(['/users/search']);
        echo Select2::widget(['options' => ['placeholder' => 'To:'], 'model' => new \app\models\User(), 'theme' => Select2::THEME_KRAJEE, 'name' => 'receiver_id', 'pluginOptions' => ['allowClear' => true, 'minimumInputLength' => 3, 'ajax' => ['url' => $url, 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }')], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('function(city) { return city.text; }'), 'templateSelection' => new JsExpression('function (city) { return city.text; }')]]);
        $Message = Yii::t('app', 'Message');
        $placeholder = Yii::t('app', 'Enter you message..');
        echo <<<HTML

<div style="margin:20px 0 25px 0;">
    <div class="form-group">
        <label for="comment">{$Message} :</label>
        <textarea placeholder="{$placeholder}" class="form-control" rows="5" id="message" style="max-width:100%;"></textarea>
    </div>
</div>


HTML;
        Modal::end();
        return ob_get_clean();
    }
开发者ID:abutouq,项目名称:video,代码行数:28,代码来源:MessageHelper.php

示例14: initDefaultButtons

 protected function initDefaultButtons()
 {
     if (!isset($this->buttons['view'])) {
         $this->buttons['view'] = function ($url, $model, $key) {
             Modal::begin(['id' => 'gridview_view_modal_' . $key, 'header' => '<h2>Detail</h2>']);
             echo DetailView::widget(['model' => $model, 'attributes' => $this->getDataCellDetailAttributes($model, $key)]);
             Modal::end();
             $options = array_merge(['class' => 'btn btn-light btn-icon', 'data-toggle' => 'modal', 'data-target' => '#gridview_view_modal_' . $key, 'title' => Yii::t('yii', 'View'), 'aria-label' => Yii::t('yii', 'View'), 'data-pjax' => '0'], $this->buttonOptions);
             return Html::a('<span class="glyphicon">&#xe620;</span>', $url, $options);
         };
     }
     if (!isset($this->buttons['update'])) {
         $this->buttons['update'] = function ($url, $model, $key) {
             $options = array_merge(['class' => 'btn btn-light btn-icon', 'title' => Yii::t('yii', 'Update'), 'aria-label' => Yii::t('yii', 'Update'), 'data-pjax' => '0'], $this->buttonOptions);
             return Html::a('<span class="glyphicon">&#xe61f;</span>', $url, $options);
         };
     }
     if (!isset($this->buttons['delete'])) {
         $this->buttons['delete'] = function ($url, $model, $key) {
             $options = array_merge(['class' => 'btn btn-light btn-icon', 'title' => Yii::t('yii', 'Delete'), 'aria-label' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0'], $this->buttonOptions);
             return Html::a('<span class="glyphicon">&#xe61e;</span>', $url, $options);
         };
     }
 }
开发者ID:ailingsen,项目名称:betterdebt,代码行数:24,代码来源:ActionColumn.php

示例15: function

echo GridView::widget(['dataProvider' => $dataProvider, 'hover' => true, 'filterSelector' => "input[name='" . $dataProvider->getPagination()->pageSizeParam . "'],input[name='" . $dataProvider->getPagination()->pageParam . "']", 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => '<h4>' . Html::encode($this->title) . '</h4>'], 'columns' => [['attribute' => 'virtual_id', 'value' => 'virtual.name'], ['class' => 'yii\\grid\\ActionColumn', 'header' => 'Actions', 'buttons' => ['delete' => function ($url, $model, $key) {
    $url = $_SERVER["SCRIPT_NAME"] . '?r=out-subsgroup-virtual/delete&id=' . $model->id;
    return Html::a('<span class="glyphicon glyphicon-trash"></span>', '#', ['title' => Yii::t('yii', 'Delete'), 'class' => 'delete']);
}, 'view' => function ($url, $model, $key) {
    // return "<span class='glyphicon glyphicon-eye-open'></span>";
    return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', '#', ['title' => Yii::t('yii', 'View'), 'class' => 'view']);
}, 'update' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-pencil"></span>', '#', ['title' => Yii::t('yii', 'Update'), 'class' => 'update']);
}]]]]);
?>
    <?php 
Pjax::end();
?>
</div>
<?php 
Modal::begin(['header' => '<h4>Advanced Search</h4>', 'id' => 'advanced-search-out-subsgroup-virtual', 'size' => 'modal-lg']);
echo "{$this->render('_search', ['model' => $searchModel])}";
Modal::end();
$url = $_SERVER["SCRIPT_NAME"] . '?r=out-subsgroup-virtual';
$js = <<<JS
   
    
    \$(document).on('ready pjax:success', function() {
        console.log('pjax:success');
        \$('.update').on('click',function(){
            var id = \$(this).closest('tr').data('key');
            \$('#modal').modal('show')
                .find('#modalContent')
                .load('{$url}/update&id='+id);
        });
开发者ID:budipratama,项目名称:admin_lte,代码行数:30,代码来源:index.php


注:本文中的yii\bootstrap\Modal::begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。