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


PHP Html::ul方法代码示例

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


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

示例1: run

 public function run()
 {
     $elements = $this->cart->elements;
     if (empty($elements)) {
         $cart = Html::tag('div', yii::t('cart', 'Your cart empty'), ['class' => 'pistol88-cart pistol88-empty-cart']);
     } else {
         $cart = Html::ul($elements, ['item' => function ($item, $index) {
             return $this->_row($item);
         }, 'class' => 'pistol88-cart-list']);
     }
     if (!empty($elements)) {
         $bottomPanel = '';
         if ($this->showTotal) {
             $bottomPanel .= Html::tag('div', Yii::t('cart', 'Total') . ': ' . yii::$app->cart->cost . ' ' . yii::$app->cart->currency, ['class' => 'pistol88-cart-total-row']);
         }
         if ($this->offerUrl && $this->showOffer) {
             $bottomPanel .= Html::a(yii::t('cart', 'Offer'), $this->offerUrl, ['class' => 'pistol88-cart-offer-button btn btn-success']);
         }
         if ($this->showTruncate) {
             $bottomPanel .= TruncateButton::widget();
         }
         $cart .= Html::tag('div', $bottomPanel, ['class' => 'pistol88-cart-bottom-panel']);
     }
     $cart = Html::tag('div', $cart, ['class' => 'pistol88-cart']);
     if ($this->type == self::TYPE_DROPDOWN) {
         $button = Html::button($this->textButton . Html::tag('span', '', ["class" => "caret"]), ['class' => 'btn dropdown-toggle', 'id' => 'pistol88-cart-drop', 'type' => "button", 'data-toggle' => "dropdown", 'aria-haspopup' => 'true', 'aria-expanded' => "false"]);
         $list = Html::tag('div', $cart, ['class' => 'dropdown-menu', 'aria-labelledby' => 'pistol88-cart-drop']);
         $cart = Html::tag('div', $button . $list, ['class' => 'pistol88-cart-dropdown dropdown']);
     }
     return Html::tag('div', $cart, ['class' => 'pistol88-cart-block']);
 }
开发者ID:oakcms,项目名称:oakcms,代码行数:31,代码来源:ElementsList.php

示例2: run

 public function run()
 {
     return Html::ul($this->flatPageList, ['class' => $this->htmlClass, 'item' => function ($flatPage, $index) {
         $class = $flatPage->matchRequestedRoute() ? $this->activeLiClass : null;
         return Html::tag('li', Html::a($flatPage->anchor, $flatPage->getRoute()), ['class' => $class]);
     }]);
 }
开发者ID:HeavyDots,项目名称:heavyCMS,代码行数:7,代码来源:FlatPageList.php

示例3: renderDolzhnosti

 /**
  * @param RabotaFizLica $rabota
  * @return string
  */
 private function renderDolzhnosti($rabota)
 {
     foreach ($rabota->getDolzhnosti_fiz_lica_na_rabote_rel()->each() as $dolzhnost) {
         $dolzhnosti[] = ArrayHelper::getValue($dolzhnost, 'dolzhnost_rel.nazvanie');
     }
     return isset($dolzhnosti) ? Html::ul($dolzhnosti, ['class' => 'dolzhnosti', 'encode' => false]) : '';
 }
开发者ID:tsyrya,项目名称:mybriop,代码行数:11,代码来源:WorkColumn.php

示例4: renderItem

 public function renderItem($header, $item, $index)
 {
     if (array_key_exists('content', $item)) {
         $id = $this->options['id'] . '-collapse' . $index;
         $options = ArrayHelper::getValue($item, 'contentOptions', []);
         $options['id'] = $id;
         $expanded = false;
         if (array_key_exists('expanded', $item)) {
             $expanded = $item['expanded'];
         }
         Html::addCssClass($options, 'panel-collapse collapse' . ($expanded ? ' in' : ''));
         $encodeLabel = isset($item['encode']) ? $item['encode'] : $this->encodeLabels;
         if ($encodeLabel) {
             $header = Html::encode($header);
         }
         $headerToggle = Html::a($header, '#' . $id, ['class' => 'collapse-toggle', 'data-toggle' => 'collapse', 'data-parent' => '#' . $this->options['id']]) . "\n";
         $header = Html::tag('h4', $headerToggle, ['class' => 'panel-title']);
         if (is_string($item['content'])) {
             $content = Html::tag('div', $item['content'], ['class' => 'panel-body']) . "\n";
         } elseif (is_array($item['content'])) {
             $content = Html::ul($item['content'], ['class' => 'list-group', 'itemOptions' => ['class' => 'list-group-item'], 'encode' => false]) . "\n";
             if (isset($item['footer'])) {
                 $content .= Html::tag('div', $item['footer'], ['class' => 'panel-footer']) . "\n";
             }
         } else {
             throw new InvalidConfigException('The "content" option should be a string or array.');
         }
     } else {
         throw new InvalidConfigException('The "content" option is required.');
     }
     $group = [];
     $group[] = Html::tag('div', $header, ['class' => 'panel-heading']);
     $group[] = Html::tag('div', $content, $options);
     return implode("\n", $group);
 }
开发者ID:kintastish,项目名称:mobil,代码行数:35,代码来源:Collapse.php

示例5: renderItems

 /**
  * @return string
  */
 protected function renderItems()
 {
     return Html::ul($this->items, ['encode' => false, 'item' => function ($item, $index) {
         if (!isset($item['fontSize'])) {
             $item['fontSize'] = self::DEFAULT_FONT_SIZE;
         }
         $html = '';
         $html .= Html::beginTag('li', ['data-transition' => 'fade', 'data-slotamount' => '1', 'data-masterspeed' => '1000', 'data-style' => 'dark']);
         $html .= Html::img($item['imageUrl'], ['data-bgposition' => 'center center', 'data-bgfit' => 'cover', 'data-bgrepeat' => 'no-repeat']);
         // MAIN TITLE
         $html .= Html::beginTag('div', ['class' => 'caption customin customout', 'data-x' => 'center', 'data-y' => 'center', 'data-hoffset' => '', 'data-voffset' => '-30', 'data-speed' => '500', 'data-start' => '1000', 'data-customin' => 'x:0;y:0;z:0;rotationX:0.5;rotationY:0;rotationZ:0;scaleX:0.75;scaleY:0.75;skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;', 'data-customout' => 'x:0;y:0;z:0;rotationX:0;rotationY:0;rotationZ:0;scaleX:0.75;scaleY:0.75;skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;', 'data-easing' => 'Back.easeOut', 'data-splitin' => 'none', 'data-splitout' => 'none', 'data-elementdelay' => '0.1', 'data-endelementdelay' => '0.1', 'data-endspeed' => '600']);
         $html .= Html::tag('h3', $item['title'], ['class' => "c-main-title c-font-{$item['fontSize']} c-font-bold c-font-center c-font-uppercase c-font-white c-block"]);
         $html .= Html::endTag('div');
         // SUB TITLE
         if (isset($item['subTitle'])) {
             $html .= Html::beginTag('div', ['class' => 'caption customin customout', 'data-x' => 'left', 'data-y' => 'bottom', 'data-hoffset' => '', 'data-voffset' => '', 'data-speed' => '500', 'data-start' => '1800', 'data-customin' => 'x:0;y:0;z:0;rotationX:0.5;rotationY:0;rotationZ:0;scaleX:0.75;scaleY:0.75;skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;', 'data-customout' => 'x:0;y:0;z:0;rotationX:0;rotationY:0;rotationZ:0;scaleX:0.75;scaleY:0.75;skewX:0;skewY:0;opacity:0;transformPerspective:600;transformOrigin:50% 50%;', 'data-easing' => 'Back.easeOut', 'data-splitin' => 'none', 'data-splitout' => 'none', 'data-elementdelay' => '0.1', 'data-endelementdelay' => '0.1', 'data-endspeed' => '600', 'style' => 'width: 100%;']);
             $html .= Html::beginTag('div', ['class' => 'c-action-bar']);
             $html .= Html::beginTag('div', ['class' => 'container']);
             $html .= Html::beginTag('div', ['class' => 'c-content']);
             $html .= Html::tag('h3', $item['subTitle'], ['class' => 'c-font-30 c-font-sbold c-font-white']);
             $html .= Html::endTag('div');
             $html .= Html::endTag('div');
             $html .= Html::endTag('div');
             $html .= Html::endTag('div');
         }
         $html .= Html::endTag('li');
         return $html;
     }]);
 }
开发者ID:anli,项目名称:yii2-jango,代码行数:32,代码来源:RevoSlider8.php

示例6: run

 public function run()
 {
     return Html::ul($this->flatPageList, ['class' => $this->htmlClass, 'item' => function ($flatPage, $index) {
         $class = $flatPage->url == Yii::$app->controller->action->id ? $this->activeLiClass : null;
         return Html::tag('li', Html::a($flatPage->anchor, [$flatPage->url]), ['class' => $class]);
     }]);
 }
开发者ID:eltortuganegra,项目名称:heavyCMS,代码行数:7,代码来源:FlatPageList.php

示例7: ulWithLink

 public static function ulWithLink($items, $className = '', $isInline = false)
 {
     $finalClass = $isInline ? "{$className} list-inline" : $className;
     return Html::ul($items, ['item' => function ($item, $index) {
         $link = Html::a($item, $item->siteUrl);
         return "<li>{$link}</li>";
     }, 'class' => $finalClass]);
 }
开发者ID:RubenDjOn,项目名称:originofthememes,代码行数:8,代码来源:Tools.php

示例8: actionAjaxElementsList

 public function actionAjaxElementsList()
 {
     $model = yii::$app->order->get(yii::$app->request->post('orderId'));
     $elements = Html::ul($model->elements, ['item' => function ($item, $index) {
         return Html::tag('li', "{$item->getModel()->getCartName()} - {$item->base_price} {$this->module->currency}x{$item->count}", ['class' => 'post']);
     }]);
     die(json_encode(['elementsHtml' => $elements]));
 }
开发者ID:pistol88,项目名称:yii2-order,代码行数:8,代码来源:ToolsController.php

示例9: renderSortLinks

 /**
  * Renders the sort links.
  * @return string the rendering result
  */
 protected function renderSortLinks()
 {
     $attributes = empty($this->attributes) ? array_keys($this->sort->attributes) : $this->attributes;
     $links = [];
     foreach ($attributes as $name) {
         $links[] = $this->sort->link($name);
     }
     return Html::ul($links, array_merge($this->options, ['encode' => false]));
 }
开发者ID:hucongyang,项目名称:lulucms2,代码行数:13,代码来源:LinkSorter.php

示例10: renderKursy

 /**
  * @param Kurs[] $kursy
  * @return string
  */
 private function renderKursy($kursy)
 {
     return Html::ul(array_map(function (Kurs $item) {
         /* @var $formatter Formatter */
         $formatter = Yii::$app->formatter;
         $rukovoditel = Html::encode($formatter->asFizLico($item->rukovoditel_rel));
         return Html::encode($item->nazvanie) . ' ' . Html::tag('span', "(руководитель: {$rukovoditel})", ['class' => 'rukovoditel']);
     }, $kursy), ['encode' => false]);
 }
开发者ID:tsyrya,项目名称:mybriop,代码行数:13,代码来源:PrepodavatelPeresechenieContent.php

示例11: run

 public function run()
 {
     $variantsList = $this->field->variants;
     $this->options['class'] .= ' field-variants';
     $this->options['item'] = function ($item, $index) {
         return $this->variant($item, $this->model->getFieldVariantIds($this->field->slug));
     };
     $variants = Html::ul($variantsList, $this->options);
     return $variants;
 }
开发者ID:pistol88,项目名称:yii2-field,代码行数:10,代码来源:Checkbox.php

示例12: renderDataCellContent

 /**
  * @param FizLico $model
  * @param mixed $key
  * @param int $index
  * @return string
  */
 public function renderDataCellContent($model, $key, $index)
 {
     /* @var $formatter Formatter */
     $formatter = Yii::$app->formatter;
     if ($model->telefon) {
         $contacts[] = $formatter->asHtmlTelefon($model->telefon);
     }
     if ($model->email) {
         $contacts[] = $formatter->asEmail($model->email);
     }
     return isset($contacts) ? Html::ul($contacts, ['encode' => false]) : $this->grid->emptyCell;
 }
开发者ID:tsyrya,项目名称:mybriop,代码行数:18,代码来源:ContactsColumn.php

示例13: run

 public function run()
 {
     return \yii\helpers\Html::ul(array_merge($this->effects, ['iron' => $this->resources->iron, 'steel' => $this->resources->steel, 'chemicals' => $this->resources->chemicals, 'vv4a' => $this->resources->vv4a, 'population' => $this->resources->population, 'ice' => $this->resources->ice, 'water' => $this->resources->water, 'energy' => $this->resources->energy, 'credits' => $this->resources->credits]), ['class' => 'balance', 'item' => function ($item, $index) {
         $item = intval($item);
         if ($item === 0) {
             return '';
         } elseif ($item > 0) {
             return "<li>+{$item} {$index}</li>";
         } else {
             return "<li>{$item} {$index}</li>";
         }
     }]);
 }
开发者ID:iw-reload,项目名称:iw,代码行数:13,代码来源:BalanceWidget.php

示例14: run

 public function run()
 {
     $variantsList = $this->filter->variants;
     $this->options['class'] .= ' filter-variants';
     $this->options['item'] = function ($item, $index) {
         return $this->variant($item);
     };
     $variants = Html::ul($variantsList, $this->options);
     $new = [];
     $new[] = Html::input('text', 'variant_value', '', ['placeholder' => 'Новый вариант', 'data-filter-id' => $this->filter->id, 'data-create-action' => Url::toRoute(['/filter/filter-variant/create']), 'class' => ' form-control']);
     $new[] = Html::button(Html::tag('i', '', ['class' => 'glyphicon glyphicon-plus']), ['class' => 'btn btn-success']);
     $variants .= Html::tag('div', implode('', $new), ['class' => 'new-variant']);
     return $variants;
 }
开发者ID:oakcms,项目名称:oakcms,代码行数:14,代码来源:Checkbox.php

示例15: actionGetSessions

 public function actionGetSessions()
 {
     $date = date('Y-m-d', strtotime(yii::$app->request->post('date')));
     $session = yii::$app->worksess->getSessions(null, $date);
     $json = [];
     if (empty($session)) {
         $json['HtmlList'] = '<ul><li>Сессии не были открыты.</li></ul>';
     } else {
         $json['HtmlList'] = Html::ul($session, ['item' => function ($item, $index) {
             return html::tag('li', Html::a(date('d.m.Y H:i:s', $item->start_timestamp) . ' ' . $item->shiftName, ['/service/report/index', 'sessionId' => $item->id]));
         }]);
     }
     die(json_encode($json));
 }
开发者ID:pistol88,项目名称:yii2-service,代码行数:14,代码来源:ReportController.php


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