本文整理汇总了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}';
}
示例2: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
if (!isset($this->header)) {
$this->header = Yii::t('app', 'Disabled status');
}
}
示例3: init
public function init()
{
if (!Yii::$app->getRequest()->getIsAjax()) {
DropdownAsset::register($this->grid->getView());
}
parent::init();
}
示例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 . ';'];
}
示例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();
}
示例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')]);
}
}
示例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']);
};
}
示例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;
}
};
}
}
示例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();
}
示例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]);
}
}
}
示例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();
}
示例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;
};
}
示例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();
}
示例14: init
/**
* Initializes the action column and triggers rendering of default buttons.
* See [[initDefaultButtons]] for details.
*/
public function init()
{
parent::init();
$this->initDefaultButtons();
}
示例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();
}