當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GridView::renderTableHeader方法代碼示例

本文整理匯總了PHP中yii\grid\GridView::renderTableHeader方法的典型用法代碼示例。如果您正苦於以下問題:PHP GridView::renderTableHeader方法的具體用法?PHP GridView::renderTableHeader怎麽用?PHP GridView::renderTableHeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yii\grid\GridView的用法示例。


在下文中一共展示了GridView::renderTableHeader方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: renderTableHeader

 /**
  * @inheritdoc
  * @return string
  */
 public function renderTableHeader()
 {
     if (!$this->showHeader) {
         return parent::renderTableHeader();
     }
     $cells = [];
     foreach ($this->columns as $column) {
         /* @var $column Column */
         $cells[] = $column->renderHeaderCell();
     }
     $content = Html::tag('tr', implode('', $cells), $this->headerRowOptions);
     if ($this->filterPosition == self::FILTER_POS_HEADER) {
         $content = $this->renderFilters() . $content;
     } elseif ($this->filterPosition == self::FILTER_POS_BODY) {
         $content .= $this->renderFilters();
     }
     return "<tbody>\n" . $content . "\n";
 }
開發者ID:h11Nox,項目名稱:slug,代碼行數:22,代碼來源:GridView.php

示例2: renderTableHeader

 public function renderTableHeader()
 {
     if ($this->customHeader) {
         $cells = [];
         foreach ($this->columns as $column) {
             $cells[] = $column->renderHeaderCell();
         }
         $content = preg_replace_callback('/\\{column([0-9]+)\\}/Sui', function ($m) use($cells) {
             $index = $m[1] - 1;
             return isset($cells[$index]) ? $cells[$index] : '';
         }, $this->customHeader);
         if ($this->filterPosition === self::FILTER_POS_HEADER) {
             $content = $this->renderFilters() . $content;
         } elseif ($this->filterPosition === self::FILTER_POS_BODY) {
             $content .= $this->renderFilters();
         }
         return "<thead>\n" . $content . "\n</thead>";
     } else {
         return parent::renderTableHeader();
     }
 }
開發者ID:vsguts,項目名稱:crm,代碼行數:21,代碼來源:GridView.php

示例3: renderTableHeader

 /**
  * Overide parent::run().
  */
 public function renderTableHeader()
 {
     if ($this->dataProvider != null) {
         return parent::renderTableHeader();
     } else {
         $content = [];
         foreach ($this->attrColumnsHeader as $column) {
             if (is_string($column)) {
                 $content[] = Html::tag('th', $column, $this->headerRowOptions);
             } else {
                 if (isset($column['class']) && $column['class'] == 'yii\\grid\\SerialColumn') {
                     $content[] = Html::tag('th', '#', $this->headerRowOptions);
                 }
             }
         }
         $content = Html::tag('tr', implode('', $content), $this->headerRowOptions);
         return "<thead>\n" . $content . "\n</thead>";
     }
 }
開發者ID:utiuam,項目名稱:uamext,代碼行數:22,代碼來源:GridView.php

示例4: renderTableHeader

 /**
  * Renders the table header.
  *
  * @return string the rendering result.
  */
 public function renderTableHeader()
 {
     $content = parent::renderTableHeader();
     return strtr($content, ['<thead>' => "<thead>\n" . $this->generateRows($this->beforeHeader), '</thead>' => $this->generateRows($this->afterHeader) . "\n</thead>"]);
 }
開發者ID:t-tomek,項目名稱:yii2-grid,代碼行數:10,代碼來源:GridView.php


注:本文中的yii\grid\GridView::renderTableHeader方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。