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


PHP Html::tag方法代码示例

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


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

示例1: run

 public function run()
 {
     $this->options['class'] = 'ajax-form';
     parent::run();
     $content = ob_get_clean();
     return Html::tag('div', $content, ['class' => 'ajax-form-wrapper', 'style' => "max-width:{$this->maxWidth}px"]);
 }
开发者ID:promo-pr,项目名称:cms,代码行数:7,代码来源:AjaxForm.php

示例2: run

 public function run()
 {
     $this->genButton = Html::a(Icon::show('edit') . Yii::t('app', 'Generate'), '#', ['class' => 'btn btn-success', 'id' => 'btn-generate']);
     $parent_id = $this->model->main_category_id;
     $owner_id = $this->model->id;
     $this->addButton = Html::a(Icon::show('plus') . Yii::t('app', 'Add'), Url::toRoute(['/shop/backend-product/edit', 'parent_id' => $parent_id, 'owner_id' => $owner_id, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()]), ['class' => 'btn btn-success', 'id' => 'btn-add']);
     if (!empty($this->footer)) {
         $this->footer = Html::tag('div', $this->addButton . ' ' . $this->genButton, ['class' => 'widget-footer']);
     }
     $this->object = Object::getForClass(get_class($this->model));
     $rest_pg = (new Query())->select('id, name')->from(PropertyGroup::tableName())->where(['object_id' => $this->object->id])->orderBy('sort_order')->all();
     $this->property_groups_to_add = [];
     foreach ($rest_pg as $row) {
         $this->property_groups_to_add[$row['id']] = $row['name'];
     }
     $optionGenerate = Json::decode($this->model->option_generate);
     if (null === PropertyGroup::findOne($optionGenerate['group'])) {
         $this->model->option_generate = $optionGenerate = null;
     }
     $groupModel = null;
     if (isset($optionGenerate['group'])) {
         $groupModel = PropertyGroup::findOne($optionGenerate['group']);
         $properties = Property::getForGroupId($optionGenerate['group']);
     } else {
         $group_ids = array_keys($this->property_groups_to_add);
         $group_id = array_shift($group_ids);
         $groupModel = PropertyGroup::findOne($group_id);
         $properties = Property::getForGroupId($group_id);
     }
     if (is_null($groupModel)) {
         $groupModel = new PropertyGroup();
     }
     return $this->render($this->viewFile, ['model' => $this->model, 'form' => $this->form, 'groups' => $this->property_groups_to_add, 'groupModel' => $groupModel, 'properties' => $properties, 'optionGenerate' => $optionGenerate, 'footer' => $this->footer]);
 }
开发者ID:tqsq2005,项目名称:dotplant2,代码行数:34,代码来源:OptionGenerate.php

示例3: renderDataCellContent

 /**
  * @inheritdoc
  */
 protected function renderDataCellContent($model, $key, $index)
 {
     $value = $this->getDataCellValue($model, $key, $index);
     $name = $this->getLabelName($model, $key, $index, $value);
     $class = ArrayHelper::getValue($this->cssCLasses, $value, 'default');
     $html = Html::tag('span', Html::encode($name), ['class' => 'label label-' . $class]);
     return $value === null ? $this->grid->emptyCell : $html;
 }
开发者ID:promo-pr,项目名称:cms,代码行数:11,代码来源:SetColumn.php

示例4: renderDataCellContent

 protected function renderDataCellContent($model, $key, $index)
 {
     $value = $this->getDataCellValue($model, $key, $index);
     $label = $value ? $this->getRoleLabel($value) : $value;
     $class = $value == $this->defaultRole ? 'primary' : 'danger';
     $html = Html::tag('span', Html::encode($label), ['class' => 'label label-' . $class]);
     return $value === null ? $this->grid->emptyCell : $html;
 }
开发者ID:promo-pr,项目名称:cms,代码行数:8,代码来源:RoleColumn.php

示例5: renderDataCell

 /**
  * @inheritdoc
  */
 public function renderDataCell($model, $key, $index)
 {
     if (!$this->_isContextMenu) {
         return parent::renderDataCell($model, $key, $index);
     } else {
         $options = $this->fetchContentOptions($model, $key, $index);
         $this->parseExcelFormats($options, $model, $key, $index);
         $out = $this->renderDataCellContent($model, $key, $index);
         return Html::tag('td', $out, $options);
     }
 }
开发者ID:liyunfang,项目名称:yii2-contextmenu,代码行数:14,代码来源:KartikSerialColumn.php

示例6: run

 public function run()
 {
     if (!empty($this->footer)) {
         $this->footer = Html::tag('div', $this->footer, ['class' => 'widget-footer']);
     }
     if (!empty($this->icon)) {
         $this->title = Icon::show($this->icon) . $this->title;
     }
     $this->params['title'] = $this->title;
     $this->params['header_append'] = $this->header_append;
     $this->params['footer'] = $this->footer;
     $this->params['_id'] = $this->getId();
     return parent::run();
 }
开发者ID:tqsq2005,项目名称:dotplant2,代码行数:14,代码来源:BackendWidget.php

示例7: renderAddon

 protected function renderAddon(&$options, $type = 'picker')
 {
     if ($options === false) {
         return '';
     }
     if (is_string($options)) {
         return $options;
     }
     Html::addCssClass($options, 'input-group-addon');
     $icon = $type === 'picker' ? 'date_range' : 'close';
     $icon = '<i class="glyphicon-calendar material-icons">' . $icon . '</i>';
     if (empty($options['title'])) {
         $title = $type === 'picker' ? Yii::t('kvdtime', 'Select date & time') : Yii::t('kvdtime', 'Clear field');
         if ($title != false) {
             $options['title'] = $title;
         }
     }
     return Html::tag('span', $icon, $options);
 }
开发者ID:promo-pr,项目名称:cms,代码行数:19,代码来源:DateTimePicker.php

示例8: run

 public function run()
 {
     $rb = Yii::$app->user->can(Rbac::PERMISSION_ADMIN_PANEL);
     $model = new $this->model();
     $points = $model::find()->all();
     if (count($points) > 0) {
         $geoObject = ['type' => 'FeatureCollection'];
         foreach ($points as $point) {
             if ($rb) {
                 $delete = '<hr>' . Html::a('<i class="material-icons">create</i> Редактировать', ['/admin/default/map-edit', 'id' => $point->id]) . '&nbsp;&nbsp;&nbsp;' . Html::a('<i class="material-icons">delete</i> Удалить', ['/admin/default/map-delete', 'id' => $point->id]);
             } else {
                 $delete = '';
             }
             $geoObject['features'][] = ['type' => 'Feature', 'id' => $point->id, 'geometry' => ['type' => 'Point', 'coordinates' => explode(',', $point->point)], 'properties' => ['balloonContent' => $point->body . $delete, 'iconContent' => $point->title], 'options' => ['id' => $point->id, 'preset' => $point->preset]];
         }
     } else {
         $geoObject = false;
     }
     $view = $this->view;
     $view->registerJs("var geoObj = " . Json::encode($geoObject) . ";", $view::POS_HEAD);
     MapInputAsset::register($view);
     return Html::tag('div', '', ['id' => 'map', 'style' => "height:{$this->height}px"]);
 }
开发者ID:promo-pr,项目名称:cms,代码行数:23,代码来源:MapInput.php

示例9: function

 * @var \app\models\Form $searchModel
 */
use kartik\dynagrid\DynaGrid;
use kartik\helpers\Html;
$this->title = Yii::t('app', 'Currencies');
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
echo app\widgets\Alert::widget(['id' => 'alert']);
$this->beginBlock('add-button');
echo \yii\helpers\Html::a(\kartik\icons\Icon::show('plus') . ' ' . Yii::t('app', 'Add'), ['edit', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']);
echo \app\backend\widgets\RemoveAllButton::widget(['url' => 'remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]);
$this->endBlock();
?>



<div class="row">
    <div class="col-md-12">
        <?php 
echo DynaGrid::widget(['options' => ['id' => 'currencies-grid'], 'columns' => [['class' => \app\backend\columns\CheckboxColumn::className()], 'id', 'name', 'iso_code', 'convert_nominal', 'convert_rate', ['attribute' => 'currency_rate_provider_id', 'class' => \kartik\grid\EditableColumn::className(), 'editableOptions' => ['data' => [0 => '-'] + \app\components\Helper::getModelMap(\app\modules\shop\models\CurrencyRateProvider::className(), 'id', 'name'), 'inputType' => 'dropDownList', 'placement' => 'left', 'formOptions' => ['action' => 'update-editable']], 'filter' => \app\components\Helper::getModelMap(\app\modules\shop\models\CurrencyRateProvider::className(), 'id', 'name'), 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
    if ($model === null || $model->rateProvider === null) {
        return null;
    }
    return Html::tag('div', $model->rateProvider->name, ['class' => $model->rateProvider->name]);
}], ['class' => \app\backend\components\ActionColumn::className()]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => $this->render('_tabs', ['currencies' => true]), 'after' => $this->blocks['add-button']]]]);
?>
    </div>
</div>
开发者ID:tqsq2005,项目名称:dotplant2,代码行数:30,代码来源:index.php

示例10: run

 public function run()
 {
     $options = ['model' => $this->model, 'form' => $this->_form, 'attributes' => $this->attributes] + $this->options;
     echo Form::widget($options);
     if ($this->buttons != null) {
         $tag = ArrayHelper::remove($this->buttonsContainer, 'tag', 'div');
         echo Html::tag($tag, $this->_buttons, $this->buttonsContainer);
     }
     ActiveForm::end();
 }
开发者ID:imagis,项目名称:yii2-user,代码行数:10,代码来源:BaseForm.php

示例11:

<?php

/**
 * @var $dataProvider \yii\data\ActiveDataProvider
 * @var $searchModel \app\components\SearchModel
 * @var $this \yii\web\View
 */
use app\backend\components\ActionColumn;
use kartik\dynagrid\DynaGrid;
use kartik\helpers\Html;
use kartik\icons\Icon;
$this->title = Yii::t('app', 'Users');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">
    <?php 
echo DynaGrid::widget(['options' => ['id' => 'users-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], 'id', 'username', 'email:email', ['attribute' => 'status', 'filter' => \app\modules\user\models\User::getStatuses()], 'create_time:datetime', ['class' => ActionColumn::className(), 'options' => ['width' => '95px'], 'buttons' => [['url' => 'update', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'options' => ['data-action' => 'delete'], 'label' => Yii::t('app', 'Delete')]]]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']), 'after' => Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/user/backend-user/update'], ['class' => 'btn btn-success']) . \app\backend\widgets\RemoveAllButton::widget(['url' => '/user/backend-user/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']])]]]);
?>
</div>
开发者ID:Jamshid90,项目名称:dotplant2,代码行数:19,代码来源:index.php

示例12:

 * @var $form \yii\widgets\ActiveForm
 * @var $label string
 * @var $model \app\properties\AbstractModel
 * @var $multiple boolean
 * @var $property_id integer
 * @var $property_key string
 * @var $this \yii\web\View
 * @var $values \app\properties\PropertyValue
 */
use app\models\Property;
use app\modules\shop\models\Product;
use yii\helpers\ArrayHelper;
use kartik\helpers\Html;
$productIds = ArrayHelper::getColumn($values->values, 'value');
/** @var Product[] $products */
$products = Product::findAll($productIds);
?>

<dl>
    <?php 
if (count($productIds) == 0) {
    return;
}
$property = Property::findById($property_id);
echo Html::tag('dt', $property->name);
foreach ($products as $product) {
    echo Html::tag('dd', Html::a($product->name, ['@product', 'model' => $product]));
}
?>
</dl>
开发者ID:Jamshid90,项目名称:dotplant2,代码行数:30,代码来源:frontend-render.php

示例13:

<?php

use kartik\helpers\Html;
use yii\bootstrap\ActiveForm;
/* 
 * 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.
 */
$form = ActiveForm::begin(['id' => 'user-form', 'layout' => 'inline', 'method' => 'POST']);
$ka = $rowNr;
echo Html::beginTag('table');
echo Html::beginTag('tr', ['data-row' => '1']);
echo Html::tag('td', $form->field($auth, '[' . $ka . ']type')->dropDownList($auth->getTypeArr(), ['style' => 'width:120px;', 'prompt' => '--']));
echo Html::tag('td', $form->field($auth, '[' . $ka . ']allowFrom')->textInput(['style' => 'width:120px;']));
echo Html::tag('td', $form->field($auth, '[' . $ka . ']allowTo')->textInput(['style' => 'width:120px;']));
echo Html::endTag('tr');
echo Html::endTag('table');
$form->end();
开发者ID:KasselR,项目名称:yii2-kr,代码行数:19,代码来源:_authrow.php

示例14: registerAssets

 /**
  * Register assets
  */
 protected function registerAssets()
 {
     $view = $this->getView();
     DetailViewAsset::register($view);
     if (empty($this->alertWidgetOptions['closeButton'])) {
         $button = '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>';
     } else {
         $opts = $this->alertWidgetOptions['closeButton'];
         $tag = ArrayHelper::remove($opts, 'tag', 'button');
         $label = ArrayHelper::remove($opts, 'label', '&times;');
         if ($tag === 'button' && !isset($opts['type'])) {
             $opts['type'] = 'button';
         }
         $button = Html::tag($tag, $label, $opts);
     }
     $opts = ArrayHelper::getValue($this->alertWidgetOptions, 'options', []);
     if (!empty($opts['class'])) {
         $opts['class'] .= ' {class} fade in';
     } else {
         $opts['class'] = '{class} fade in';
     }
     $deleteConfirmMsg = Yii::t('kvdetail', 'Are you sure you want to delete this item?');
     $this->pluginOptions = ['fadeDelay' => $this->fadeDelay, 'alertTemplate' => Html::tag('div', $button . '{content}', $opts), 'alertMessageSettings' => $this->alertMessageSettings, 'deleteParams' => ArrayHelper::getValue($this->deleteOptions, 'params', []), 'deleteAjaxSettings' => ArrayHelper::getValue($this->deleteOptions, 'ajaxSettings', []), 'deleteConfirm' => ArrayHelper::remove($this->deleteOptions, 'confirm', $deleteConfirmMsg), 'showErrorStack' => ArrayHelper::remove($this->deleteOptions, 'showErrorStack', false)];
     $id = 'jQuery("#' . $this->container['id'] . '")';
     if ($this->enableEditMode) {
         $options['mode'] = $this->mode;
     }
     $this->registerPlugin($this->pluginName, $id);
     if ($this->tooltips) {
         $view->registerAssetBundle('yii\\bootstrap\\BootstrapPluginAsset');
         $view->registerJs($id . '.find("[data-toggle=tooltip]").tooltip();');
     }
 }
开发者ID:rumatakira,项目名称:yii2-detail-view,代码行数:36,代码来源:DetailView.php

示例15: actionUpdatePaymentType

 /**
  * @param $id
  * @return array
  * @throws BadRequestHttpException
  * @throws NotFoundHttpException
  */
 public function actionUpdatePaymentType($id)
 {
     Yii::$app->response->format = Response::FORMAT_JSON;
     $post = Yii::$app->request->post();
     if (!isset($post['Order']['payment_type_id'])) {
         throw new BadRequestHttpException();
     }
     $value = $post['Order']['payment_type_id'];
     $order = $this->findModel($id);
     $order->payment_type_id = $value;
     /** @var PaymentType $paymentType */
     $paymentType = PaymentType::findOne($value);
     if ($paymentType === null || !$order->save(true, ['payment_type_id'])) {
         return ['message' => Yii::t('app', 'Cannot change a payment type')];
     }
     return ['output' => Html::tag('span', $paymentType->name)];
 }
开发者ID:Razzwan,项目名称:dotplant2,代码行数:23,代码来源:BackendOrderController.php


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