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


PHP ActionColumn::renderDataCellContent方法代码示例

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


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

示例1: renderDataCellContent

 protected function renderDataCellContent($model, $key, $index)
 {
     $dropdownId = $this->grid->getId() . '-dropdown2-menu-' . $index;
     $this->template = implode(' ', array_keys(array_filter(['<li>{view}</li>' => ModelHelper::canRead($model), '<li>{update}</li>' => ModelHelper::canUpdate($model), '<li>{delete}</li>' => ModelHelper::canDelete($model)])));
     $fix = ['~(glyphicon\\-eye\\-open"\\>\\</span\\>)(\\</a\\>)~i' => '$1 ' . Yii::t('mozayka', 'View') . '$2', '~(glyphicon\\-pencil"\\>\\</span\\>)(\\</a\\>)~i' => '$1 ' . Yii::t('mozayka', 'Update') . '$2', '~(glyphicon\\-trash"\\>\\</span\\>)(\\</a\\>)~i' => '$1 ' . Yii::t('mozayka', 'Delete') . '$2', '~\\s+title\\="[^"]*"~i' => '', '~\\s+data\\-confirm\\="[^"]*"~i' => '', '~\\s+data\\-method\\="[^"]*"~i' => ''];
     $cellContent = preg_replace(array_keys($fix), array_values($fix), parent::renderDataCellContent($model, $key, $index));
     // dropdown2-menu
     if ($cellContent && $cellContent != $this->grid->emptyCell) {
         $cellContent = Html::button('<span class="glyphicon glyphicon-cog"></span>', ['title' => Yii::t('mozayka', 'Actions'), 'class' => 'btn btn-default btn-xs', 'data-dropdown2' => '#' . $dropdownId]) . Html::tag('div', Html::tag('ul', $cellContent, ['class' => 'dropdown2-menu']), ['id' => $dropdownId, 'class' => 'dropdown2 dropdown2-tip' . (array_search($this, $this->grid->columns) + 1 > count($this->grid->columns) / 2 ? ' dropdown2-anchor-right' : '')]);
     }
     return $cellContent;
 }
开发者ID:ivan-chkv,项目名称:yii2-mozayka,代码行数:12,代码来源:ActionColumn.php

示例2: renderDataCellContent

 /**
  * Renders the data cell.
  */
 protected function renderDataCellContent($model, $key, $index)
 {
     $content = parent::renderDataCellContent($model, $key, $index);
     $options = $this->dropdownButton;
     if ($this->_isDropdown) {
         $label = ArrayHelper::remove($options, 'label', Yii::t('kvgrid', 'Actions'));
         $caret = ArrayHelper::remove($options, 'caret', ' <span class="caret"></span>');
         $options = ArrayHelper::merge($options, ['type' => 'button', 'data-toggle' => 'dropdown']);
         Html::addCssClass($options, 'dropdown-toggle');
         $button = Html::button($label . $caret, $options);
         Html::addCssClass($this->dropdownMenu, 'dropdown-menu');
         $dropdown = $button . PHP_EOL . Html::tag('ul', $content, $this->dropdownMenu);
         return Html::tag('div', $dropdown, ['class' => 'dropdown']);
     }
     return $content;
 }
开发者ID:vespagointer,项目名称:yii2-moph,代码行数:19,代码来源:ActionColumn.php

示例3: renderDataCellContent

 protected function renderDataCellContent($model, $key, $index)
 {
     $renderDataCellContent = parent::renderDataCellContent($model, $key, $index);
     return Html::tag('div', $renderDataCellContent, ['class' => 'bk-elementActions']) . Html::tag('div', '', ['class' => 'clearfix']);
 }
开发者ID:elitedivision,项目名称:amos-core,代码行数:5,代码来源:ActionColumn.php

示例4: renderDataCellContent

 /**
  * @inheritdoc
  */
 protected function renderDataCellContent($model, $key, $index)
 {
     //update the value of the template string for the current row
     if ($this->templateInternal !== null) {
         $this->template = call_user_func($this->templateInternal, $model, $key, $index);
     }
     return parent::renderDataCellContent($model, $key, $index);
 }
开发者ID:highestgoodlikewater,项目名称:yii2-toolbox,代码行数:11,代码来源:AdvancedActionColumn.php


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