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


PHP ActionColumn::init方法代码示例

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


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

示例1: init

 public function init()
 {
     parent::init();
     $this->headerOptions['width'] = '120px';
     
     $this->template = '{update} {delete}';
 }
开发者ID:huasxin,项目名称:lulucms2,代码行数:7,代码来源:ActionColumn.php

示例2: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!isset($this->header)) {
         $this->header = Yii::t('app', 'Disabled status');
     }
 }
开发者ID:just-leo,项目名称:cardgame-serial,代码行数:10,代码来源:DisableActionColumn.php

示例3: init

 public function init()
 {
     if (!Yii::$app->getRequest()->getIsAjax()) {
         DropdownAsset::register($this->grid->getView());
     }
     parent::init();
 }
开发者ID:ivan-chkv,项目名称:yii2-mozayka,代码行数:7,代码来源:ActionColumn.php

示例4: init

 public function init()
 {
     parent::init();
     if (!isset($this->headerOptions['width'])) {
         $this->headerOptions['width'] = $this->width;
     }
     $this->contentOptions = ['class' => 'da-icon-column', 'style' => 'width:' . $this->width . ';'];
 }
开发者ID:hucongyang,项目名称:lulucms2,代码行数:8,代码来源:ActionColumn.php

示例5: init

 public function init()
 {
     $this->header = $this->header ?: Module::t('Actions');
     $this->footer = $this->footer ?: Module::t('Actions');
     $this->headerOptions = ArrayHelper::merge(['class' => 'text-align-center', 'width' => '100'], $this->headerOptions);
     $this->footerOptions = ArrayHelper::merge(['class' => 'text-align-center font-weight-bold th'], $this->footerOptions);
     $this->contentOptions = ArrayHelper::merge(['class' => 'text-align-center nowrap'], $this->contentOptions);
     parent::init();
 }
开发者ID:uran1980,项目名称:yii2-translate-panel,代码行数:9,代码来源:ActionColumn.php

示例6: init

 public function init()
 {
     parent::init();
     if (is_array($this->params)) {
         $this->params = '&' . http_build_query($this->params);
     } else {
         $this->params = '&' . http_build_query(['ref' => Yii::$app->getRequest()->get('id')]);
     }
 }
开发者ID:prawee,项目名称:yii2-grid,代码行数:9,代码来源:ActionChildColumn.php

示例7: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->buttons['update'] = function ($url, $model) {
         return Html::a('<i class="fa fa-pencil"></i> Edit', $url, ['title' => Yii::t('yii', 'Update'), 'data-pjax' => '0', 'class' => 'btn btn-primary btn-xs']);
     };
     $this->buttons['delete'] = function ($url, $model) {
         return Html::a('<i class="fa fa-trash-o"></i> Delete', $url, ['title' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0', 'class' => 'btn btn-primary btn-xs']);
     };
 }
开发者ID:perminder-klair,项目名称:kato-core,代码行数:13,代码来源:ActionColumn.php

示例8: init

 public function init()
 {
     parent::init();
     $methods = get_class_methods($this);
     preg_match_all('/button(\\w+)/', join(" ", $methods), $m);
     foreach ($m[1] as $button) {
         $this->buttons[lcfirst($button)] = function ($url, $model, $key) use($button) {
             $result = call_user_func_array([$this, "button" . $button], [$url, $model, $key]);
             if ($result instanceof ButtonColumn) {
                 return $result->asLink();
             } else {
                 return $result;
             }
         };
     }
 }
开发者ID:carono,项目名称:yii2-components,代码行数:16,代码来源:ActionColumn.php

示例9: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     if (!is_array($this->permissions)) {
         throw new InvalidConfigException('$permissions has to be an array of allowed permissions for each button.');
     }
     if (!empty($this->permissions)) {
         foreach ($this->permissions as $key => $allowedPermissions) {
             if (!$this->checkIfUserHas($allowedPermissions)) {
                 $this->buttons[$key] = function ($url, $model, $key) {
                     return;
                 };
             }
         }
     }
     parent::init();
     $this->initDefaultButtons();
 }
开发者ID:ahb360,项目名称:kalpok,代码行数:20,代码来源:ActionColumn.php

示例10: init

 /**
  * @inheritdoc
  *
  * @throws \yii\base\InvalidConfigException on invalid right config
  */
 public function init()
 {
     parent::init();
     //copy template value to internal var
     if ($this->template instanceof \Closure) {
         $this->templateInternal = $this->template;
     }
     //iterate over rights
     foreach ($this->buttonRights as $name => $value) {
         if (!isset($this->buttons[$name])) {
             continue;
         }
         if (!$this->checkRight($name, $value)) {
             unset($this->buttons[$name]);
         }
     }
 }
开发者ID:highestgoodlikewater,项目名称:yii2-toolbox,代码行数:22,代码来源:AdvancedActionColumn.php

示例11: init

    public function init(){

        $visibleColumn=$this->statusColumn;

        $this->buttons = [
            'update' => function($url,$model){
                return $this->updateButton($url,$model);
            },
            'view' => function($url,$model){
                return $this->viewButton($url,$model);
            },
            'delete' => function($url,$model) use ($visibleColumn){
                return ($model->hasAttribute($visibleColumn) && $model->$visibleColumn) ? $this->deleteButton($url,$model) : '';
            }
        ];
        parent::init();
    }
开发者ID:harish-reglobbe,项目名称:Auction,代码行数:17,代码来源:ActionColumn.php

示例12: init

 public function init()
 {
     parent::init();
     if (!isset($this->buttonOptions['class'])) {
         $this->buttonOptions['class'] = ['btn', 'btn-default', 'btn-action'];
     }
     if (!isset($this->header)) {
         $url = $this->createUrl('create', null, null, null);
         $this->header = $this->createButton($url, 'Создать', ['btn-create']);
     }
     /**
      * @param Kurs $model
      * @return bool
      */
     $this->visibleButtons['iup'] = function ($model) {
         return $model->tip === TipKursa::PP || $model->tip === TipKursa::PO;
     };
 }
开发者ID:tsyrya,项目名称:mybriop,代码行数:18,代码来源:ActionColumn.php

示例13: init

 public function init()
 {
     $this->_isDropdown = ($this->grid->bootstrap && $this->dropdown);
     if (!isset($this->header)) {
         $this->header = Yii::t('kvgrid', 'Actions');
     }
     $this->parseFormat();
     $this->parseVisibility();
     parent::init();
     $this->initDefaultButtons();
     $this->setPageRows();
 }
开发者ID:vespagointer,项目名称:yii2-moph,代码行数:12,代码来源:ActionColumn.php

示例14: init

 /**
  * Initializes the action column and triggers rendering of default buttons.
  * See [[initDefaultButtons]] for details.
  */
 public function init()
 {
     parent::init();
     $this->initDefaultButtons();
 }
开发者ID:macgyer,项目名称:yii2-materializecss,代码行数:9,代码来源:ActionColumn.php

示例15: init

 public function init()
 {
     /** @noinspection PhpUndefinedFieldInspection */
     $this->_isDropdown = $this->grid->bootstrap && $this->dropdown;
     if (!isset($this->header)) {
         $this->header = Yii::t('kvgrid', 'Actions');
     }
     $this->parseFormat();
     $this->parseVisibility();
     parent::init();
     $this->initDefaultButtons();
     $this->setPageRows();
 }
开发者ID:almirb,项目名称:yii2-grid,代码行数:13,代码来源:ActionColumn.php


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