当前位置: 首页>>代码示例>>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;未经允许,请勿转载。