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


PHP DataColumn::renderDataCellContent方法代碼示例

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


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

示例1: renderDataCellContent

 protected function renderDataCellContent($model, $key, $index)
 {
     $text = parent::renderDataCellContent($model, $key, $index);
     if (in_array($this->format, ['text', 'date', 'datetime'])) {
         return Html::a($text, null, $this->grid->prepareDetailsLink($model->id));
     }
     return $text;
 }
開發者ID:vvkgpt48,項目名稱:merchium-advanced-app,代碼行數:8,代碼來源:DataColumn.php

示例2: renderDataCellContent

 /**
  * @inheritdoc
  */
 protected function renderDataCellContent($model, $key, $index)
 {
     if ($this->content === null) {
         return Html::a('<span class="glyphicon glyphicon-arrow-up"></span>', $this->getUrl('up', $model), ['class' => 'order-link']) . Html::a('<span class="glyphicon glyphicon-arrow-down"></span>', $this->getUrl('down', $model), ['class' => 'order-link']);
     } else {
         return parent::renderDataCellContent($model, $key, $index);
     }
 }
開發者ID:Wubbleyou,項目名稱:yii2-ordermodel,代碼行數:11,代碼來源:OrderModelColumn.php

示例3: renderDataCellContent

 protected function renderDataCellContent($model, $key, $index)
 {
     if ($this->editable === true) {
         return Html::tag('a', parent::renderDataCellContent($model, $key, $index), ['class' => 'editable']);
     } else {
         return parent::renderDataCellContent($model, $key, $index);
     }
 }
開發者ID:NikDevPHP,項目名稱:yii2,代碼行數:8,代碼來源:EditableTreeGridDataColumn.php

示例4: renderDataCellContent

 protected function renderDataCellContent($model, $key, $index)
 {
     if ($this->content === null) {
         return $this->getDataCellValue($model, $key, $index);
     } else {
         return parent::renderDataCellContent($model, $key, $index);
     }
 }
開發者ID:andreosoft,項目名稱:andreocms,代碼行數:8,代碼來源:ImageColumn.php

示例5: renderDataCellContent

 /**
  * @inheritdoc
  */
 protected function renderDataCellContent($model, $key, $index)
 {
     $value = parent::renderDataCellContent($model, $key, $index);
     if ($this->getDataCellValue($model, $key, $index) == true) {
         return "<span class=\"label label-success\">{$value}</span>";
     } else {
         return "<span class=\"label label-default\">{$value}</span>";
     }
 }
開發者ID:just-leo,項目名稱:cardgame-serial,代碼行數:12,代碼來源:BooleanFilterColumn.php

示例6: renderDataCellContent

 protected function renderDataCellContent($model, $key, $index)
 {
     $content = parent::renderDataCellContent($model, $key, $index);
     if ($content == "1") {
         return "<span class=\"label " . $this->true_label_class . "\">" . Yii::t('app', $this->true_value) . "</span>";
     } else {
         return "<span class=\"label " . $this->false_label_class . "\">" . Yii::t('app', $this->false_value) . "</span>";
     }
 }
開發者ID:tqsq2005,項目名稱:dotplant2,代碼行數:9,代碼來源:BooleanStatus.php

示例7: renderDataCellContent

 protected function renderDataCellContent($model, $key, $index)
 {
     $content = parent::renderDataCellContent($model, $key, $index);
     $options = $this->grid->options;
     if (array_key_exists('href', $options) && $options['href'] != null) {
         $field = $options['field'];
         $content = Html::tag('a', $content, ['href' => $options['href'] . "?" . $field . "=" . $model->{$field}, 'class' => 'btn-block']);
     }
     return $content;
 }
開發者ID:enigmatix,項目名稱:yii2-widgets,代碼行數:10,代碼來源:DataColumn.php

示例8: renderDataCellContent

 /**
  * @inheritdoc
  */
 protected function renderDataCellContent($model, $key, $index)
 {
     /** @var $model ActiveRecord */
     if ($this->format == 'boolean') {
         return Html::activeCheckbox($model, $this->attribute, ['label' => false, 'class' => 'ajax-checkbox', 'data' => ['id' => $key, 'modelName' => $model->className(), 'attribute' => $this->attribute]]);
     }
     if ($this->content === null) {
         return $this->grid->formatter->format($this->getDataCellValue($model, $key, $index), $this->format);
     } else {
         return parent::renderDataCellContent($model, $key, $index);
     }
 }
開發者ID:tolik505,項目名稱:bl,代碼行數:15,代碼來源:ModifiedDataColumn.php

示例9: renderDataCellContent

 /**
  * @inheritdoc
  */
 protected function renderDataCellContent($model, $key, $index)
 {
     if ($this->content === null) {
         $contentParts = [];
         $variationBehavior = $this->getVariationBehavior($model);
         foreach ($variationBehavior->getVariationModels() as $variationModel) {
             $contentParts[] = '<tr><td><b>' . $this->getVariationLabel($model, $variationModel) . '</b></td><td>' . $this->getVariationValue($variationModel) . '</td>';
         }
         return Html::tag('table', implode("\n", $contentParts), $this->tableOptions);
     }
     return parent::renderDataCellContent($model, $key, $index);
 }
開發者ID:yii2tech,項目名稱:admin,代碼行數:15,代碼來源:VariationColumn.php

示例10: renderDataCellContent

 protected function renderDataCellContent($model, $key, $index)
 {
     $content = parent::renderDataCellContent($model, $key, $index);
     if (null === $this->callback_wrapper) {
         return $content;
     }
     if ($this->callback_wrapper instanceof \Closure) {
         $_content = call_user_func($this->callback_wrapper, $content, $model, $key, $index, $this);
         if (null !== $_content) {
             return $_content;
         }
     }
     return $content;
 }
開發者ID:tqsq2005,項目名稱:dotplant2,代碼行數:14,代碼來源:TextWrapper.php

示例11: renderDataCellContent

 /**
  * @inheritdoc
  */
 protected function renderDataCellContent($model, $key, $index)
 {
     $value = $model->{$this->attribute};
     if (in_array($value, $this->infinity)) {
         return "&infin;";
     } else {
         return $value;
     }
     if ($this->content === null) {
         return $this->grid->formatter->format($this->getDataCellValue($model, $key, $index), $this->format);
     } else {
         return parent::renderDataCellContent($model, $key, $index);
     }
 }
開發者ID:simplator,項目名稱:base,代碼行數:17,代碼來源:InfinityColumn.php

示例12: renderDataCellContent

 /**
  * 
  * @param \yii\base\Model $model
  * @param type $key
  * @param type $index
  * @return type
  */
 protected function renderDataCellContent($model, $key, $index)
 {
     if ($this->value !== null) {
         if (is_string($this->value)) {
             $value = ArrayHelper::getValue($model, $this->value);
         } else {
             $value = call_user_func($this->value, $model, $index, $this);
         }
     } elseif ($this->content === null && $this->attribute !== null) {
         $value = $this->renderInput($model, $index);
     } else {
         $value = parent::renderDataCellContent($model, $key, $index);
     }
     return strtr($this->template, ['{content}' => $value]);
 }
開發者ID:sangkilsoft,項目名稱:sangkilbiz-3,代碼行數:22,代碼來源:InputColumn.php

示例13: renderDataCellContent

 /**
  * @inheritdoc
  */
 protected function renderDataCellContent($model, $key, $index)
 {
     $url = $this->url;
     if (!is_array($url)) {
         $url = [$url];
     }
     foreach ($this->params as $n => $v) {
         $url[$n] = $model->{$v};
     }
     if ($this->content === null) {
         return Html::a($this->grid->formatter->format($this->getDataCellValue($model, $key, $index), $this->format), $url);
     } else {
         return Html::a(parent::renderDataCellContent($model, $key, $index), $url);
     }
 }
開發者ID:simplator,項目名稱:base,代碼行數:18,代碼來源:LinkColumn.php

示例14: renderDataCellContent

 protected function renderDataCellContent($model, $key, $index)
 {
     $content = \yii\grid\DataColumn::renderDataCellContent($model, $key, $index);
     if ($this->titles) {
         $value = ArrayHelper::getValue($this->titles, $content, $content);
     } else {
         $value = $content;
     }
     if ($this->labels) {
         $content = Html::tag('span', $value, ['class' => 'label label-grid-view label-' . ArrayHelper::getValue($this->labels, $content, self::LABEL_DEFAULT)]);
     } else {
         $content = $value;
     }
     return $content;
 }
開發者ID:omnilight,項目名稱:yz2-admin,代碼行數:15,代碼來源:DataColumn.php

示例15: renderDataCellContent

 /**
  * Renders the data cell content.
  * @param mixed $model the data model
  * @param mixed $key the key associated with the data model
  * @param integer $index the zero-based index of the data model among the models array returned by [[GridView::dataProvider]].
  * @return string the rendering result
  */
 protected function renderDataCellContent($model, $key, $index)
 {
     if ($this->grid->runInConsoleMode) {
         return parent::renderDataCellContent($model, $key, $index);
     }
     $attribute = $this->attribute;
     $value = $model->{$attribute};
     $url = [$this->action, 'id' => $model->id, 'attribute' => $attribute];
     if ($value === null || $value == true) {
         $icon = 'toggle-on';
         $title = Yii::t('yii', 'Off');
     } else {
         $icon = 'toggle-off';
         $title = Yii::t('yii', 'On');
     }
     return Html::a(Icons::i($icon . ' fa-lg'), $url, ['title' => $title, 'class' => 'grid-view-toggle-cell-link', 'data-method' => 'post', 'data-pjax' => '0']);
 }
開發者ID:omnilight,項目名稱:yz2-admin,代碼行數:24,代碼來源:ToggleColumn.php


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