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


PHP Html::tag方法代码示例

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


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

示例1: run

 public function run()
 {
     AdminlteAsset::register($this->getView());
     Html::addCssClass($this->options, ['widget' => 'progress']);
     if ($this->vertical) {
         Html::addCssClass($this->options, 'vertical');
     }
     if (!empty($this->size)) {
         Html::addCssClass($this->options, $this->size);
     }
     $barOptions = ['class' => 'progress-bar'];
     if (!empty($this->type)) {
         Html::addCssClass($barOptions, 'progress-bar-' . $this->type);
     }
     if ($this->striped) {
         Html::addCssClass($barOptions, 'progress-bar-striped');
     }
     $barOptions['style']['width'] = $this->value . '%';
     if (empty($this->text)) {
         $text = '';
     } else {
         $text = Html::tag('span', $text, ['class' => 'sr-only']);
     }
     return Html::tag('div', Html::tag('div', $text, $barOptions), $this->options);
 }
开发者ID:WiconWang,项目名称:CS-Iris,代码行数:25,代码来源:Progress.php

示例2: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     Html::addCssClass($this->options, ['widget' => 'info-box']);
     $iconOptions = ['class' => 'info-box-icon'];
     if ($this->type === self::COLORED_ICON) {
         Html::addCssClass($iconOptions, 'bg-' . $this->color);
     } else {
         Html::addCssClass($this->options, 'bg-' . $this->color);
     }
     echo Html::beginTag('div', $this->options);
     echo Html::tag('span', FA::icon($this->icon), $iconOptions);
     echo '<div class="info-box-content">';
     if (!empty($this->contents)) {
         foreach ($this->contents as $content) {
             if (is_array($content)) {
                 $type = ArrayHelper::getValue($content, 'type', 'text');
                 $text = ArrayHelper::getValue($content, 'text', '');
                 if (in_array($type, ['text', 'number'])) {
                     echo Html::tag('span', $text, ['class' => 'info-box-' . $type]);
                 } elseif ($type == 'progress') {
                     $value = ArrayHelper::getValue($content, 'value', $text);
                     echo '<div class="progress">';
                     echo Html::tag('div', '', ['class' => 'progress-bar', 'style' => ['width' => $value . '%']]);
                     echo '</div>';
                 } else {
                     echo Html::tag('span', $text, ['class' => $type]);
                 }
             } else {
                 echo $content;
             }
         }
     }
 }
开发者ID:WiconWang,项目名称:CS-Iris,代码行数:37,代码来源:InfoBox.php

示例3: run

 public function run()
 {
     if (!isset($this->parentType)) {
         throw new InvalidConfigException("Tag parent type is required.");
     }
     $tagsHtml = $this->renderWidget();
     return Html::tag('div', $tagsHtml, $this->options);
 }
开发者ID:cmsgears,项目名称:widget-tag,代码行数:8,代码来源:Tag.php

示例4: message

function message($mesasge, $error = false)
{
    if ($error) {
        echo Html::tag('div', $mesasge, array('class' => 'alert alert-danger'));
    } else {
        echo Html::tag('div', $mesasge, array('class' => 'alert alert-success'));
    }
}
开发者ID:nasrulhazim,项目名称:to-do-list-server,代码行数:8,代码来源:funcs.php

示例5: getToolTipTemplate

 /**
  * Generate the tool tip template to use in form.
  *
  * @param string $field The table field name.
  * @return string Return the tool tip template.
  */
 public function getToolTipTemplate($field)
 {
     if (array_key_exists($field, $this->toolTips())) {
         $toolTip = Html::tag('span', "{label}", ['data-content' => $this->toolTips()[$field], 'data-toggle' => 'popover', 'data-trigger' => 'hover', 'style' => 'cursor:help; border-bottom: 1px dashed #888']);
         return "{$toolTip} \n{input}\n{hint}\n{error}";
     }
     return "{label}\n{input}\n{hint}\n{error}";
 }
开发者ID:anli,项目名称:yii2-helper,代码行数:14,代码来源:ExcelImportForm.php

示例6: icon

 /**
  * Fetch the icon for a icon identifier
  *
  * @param string $id suffix the icon suffix name
  * @param array  $options the icon HTML attributes
  * @param string $prefix the icon css prefix name
  *
  * @return string the parsed icon
  */
 public function icon($id, $options = ['style' => 'margin-right:5px'], $prefix = null)
 {
     if ($prefix === null) {
         $prefix = $this->prefix;
     }
     Html::addCssClass($options, explode(' ', $prefix . $id));
     return Html::tag('i', '', $options);
 }
开发者ID:communityii,项目名称:yii2-user,代码行数:17,代码来源:Icons.php

示例7: run

 /**
  * Renders the widget.
  */
 public function run()
 {
     $this->registerPlugin('button');
     $this->label = $this->getLabel();
     if ($this->enableIcon) {
         $this->label .= Icon::widget(['label' => $this->icon, 'options' => $this->iconOptions]);
     }
     return Html::tag($this->tagName, $this->label, $this->options);
 }
开发者ID:talview,项目名称:yii2-materialize,代码行数:12,代码来源:Button.php

示例8: run

 public function run()
 {
     if (empty($this->items)) {
         return '';
     }
     $options = $this->options;
     $content = $this->renderItems();
     return Html::tag('div', $content, $options);
 }
开发者ID:xjflyttp,项目名称:yii2-weui-widget,代码行数:9,代码来源:Grid.php

示例9: testPrintsWithTheMethodWithWrapper

 /**
  * test method
  */
 public function testPrintsWithTheMethodWithWrapper()
 {
     $helper = ConcreteHelper::getInstance();
     ob_start();
     $helper->the('hey', Html::tag('span'));
     $content = ob_get_contents();
     ob_end_clean();
     $this->assertEquals('<span>hey</span>', $content);
 }
开发者ID:alterfw,项目名称:wordpress-for-developers,代码行数:12,代码来源:WD_Helper_AbstractHelper_Test.php

示例10: renderMenuItem

 protected function renderMenuItem($item)
 {
     if (isset($item['url'])) {
         $icon = isset($item['icon']) ? '<i class="fa ' . $item['icon'] . '"></i>' : '';
         $count = isset($item['count']) ? '<span class="' . (isset($item['countClass']) ? $item['countClass'] : 'dataNumGreen') . '">' . $item['count'] . '</span>' : '';
         $label = $this->linkLabelWrapper === null ? $item['label'] : Html::tag($this->linkLabelWrapper, $this->linkLabelWrapperHtmlOptions, $item['label']);
         return Html::link($icon . $label . $count, $item['url'], isset($item['linkOptions']) ? $item['linkOptions'] : array());
     } else {
         return Html::tag('span', isset($item['linkOptions']) ? $item['linkOptions'] : array(), $item['label']);
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:11,代码来源:AdminModuleMenu.php

示例11: run

 public function run()
 {
     $container = 'div';
     if (isset($this->containerOptions['tag'])) {
         $container = $this->containerOptions['tag'];
         unset($this->containerOptions['tag']);
     }
     echo Html::tag($container, Html::tag('iframe', '', $this->frameOptions), $this->containerOptions);
     if (!empty($this->callbackFunction)) {
         AssetsCallBack::register($this->getView());
         $this->getView()->registerJs("mihaildev.elFinder.register(" . Json::encode($this->id) . "," . Json::encode($this->callbackFunction) . ");");
     }
 }
开发者ID:manyoubaby123,项目名称:imshop,代码行数:13,代码来源:ElFinder.php

示例12: datagrid

 public function datagrid($mcs, $limit = 10)
 {
     // $this->debug=true;
     $datas = array_map(function ($x) {
         return $x->toArray();
     }, $this->model($mcs, null, $limit));
     // mdd($datas);
     $arrTables = array();
     foreach ($datas as $data) {
         $arrTables[] = app()->make('\\Mkny\\Cinimod\\Logic\\TableLogic')->setRows($data)->getTable();
     }
     return \Html::tag('div', $arrTables);
 }
开发者ID:mkny,项目名称:cinimod,代码行数:13,代码来源:FrontLayer.php

示例13: init

 public function init()
 {
     echo '<div class="box box-primary">' . '  <div class="box-header with-border">';
     echo Html::tag('h3', $this->options['boxTitle'], ['class' => 'box-title']);
     echo '<div class="box-tools pull-right">';
     echo Html::button('<i class="fa fa-save"></i>', ['type' => 'submit', 'class' => 'btn btn-sm btn-primary', 'title' => \Yii::t('theme/widgets/box', 'Save')]);
     echo ' ';
     if (isset($this->options['buttonUndo'])) {
         echo Html::a('<i class="fa fa-undo"></i>', $this->options['buttonUndo'], ['class' => 'btn btn-sm btn-default', 'title' => \Yii::t('theme/widgets/box', 'Undo')]);
     }
     echo '</div>';
     echo '</div>';
     echo '<div class="box-body form-horizontal">';
 }
开发者ID:andreosoft,项目名称:andreocms,代码行数:14,代码来源:DetailView.php

示例14: redirect

 public function redirect($url, $force = false, $statusCode = 302)
 {
     $params = Yii::$app->request->queryParams;
     // Meta redirect
     if (headers_sent() || ob_get_contents()) {
         $url = !empty($params['_return_url']) ? $params['_return_url'] : $url;
         $url = Url::to($url);
         $this->ech(Html::tag('meta', '', ['http-equiv' => 'Refresh', 'content' => '1;URL=' . $url . '']));
         $this->ech(Html::a(__('Continue'), $url));
     }
     if (!empty($params['_return_url']) && !$force) {
         return Yii::$app->getResponse()->redirect($params['_return_url'], $statusCode);
     }
     return parent::redirect($url, $statusCode);
 }
开发者ID:vsguts,项目名称:crm,代码行数:15,代码来源:AbstractController.php

示例15: renderForEdit

 /**
  * Returns the fields for edit screen
  * 
  * @return string
  */
 public function renderForEdit()
 {
     global $tag;
     $data = array();
     foreach ($this->dataHandler->getFillable() as $field) {
         $data[$field->getBaseName()] = apply_filters('wd-fieldcreator-get-field-' . $this->prefix . $field->getBaseName(), wd_get_term_meta($tag->term_id, $this->prefix . $field->getBaseName()));
     }
     $this->dataHandler->populate($data)->execute();
     foreach ($this->dataHandler->getContent() as $content) {
         if (is_a($content, 'FG_HTML_Form_Input_Fillable')) {
             $html[] = Html::tag('tr', array(Html::tag('th', $content->getLabel()), Html::tag('td', $content->getField())))->setClass('form-field wd-taxonomy-fieldcreator');
         } else {
             $html[] = $content;
         }
     }
     return join('', $html);
 }
开发者ID:alterfw,项目名称:wordpress-for-developers,代码行数:22,代码来源:WD_Creator_TaxonomyFieldsCreator.php


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