Commit b7fddd8d by Carsten Brandt

Added LinkPager::$linkOptions

fixes #2367
parent ac3ac5d1
......@@ -33,8 +33,10 @@ $this->params['breadcrumbs'][] = $this->title;
<?= "<?= " ?>Html::a('Update', ['update', <?= $urlParams ?>], ['class' => 'btn btn-primary']) ?>
<?= "<?php " ?>echo Html::a('Delete', ['delete', <?= $urlParams ?>], [
'class' => 'btn btn-danger',
'data-confirm' => Yii::t('app', 'Are you sure to delete this item?'),
'data-method' => 'post',
'data' => [
'confirm' => Yii::t('app', 'Are you sure to delete this item?'),
'method' => 'post',
],
]); ?>
</p>
......
......@@ -38,6 +38,10 @@ class LinkPager extends Widget
*/
public $options = ['class' => 'pagination'];
/**
* @var array HTML attributes for the link in a pager container tag.
*/
public $linkOptions = [];
/**
* @var string the CSS class for the "first" page button.
*/
public $firstPageCssClass = 'first';
......@@ -172,7 +176,9 @@ class LinkPager extends Widget
Html::addCssClass($options, $this->disabledPageCssClass);
return Html::tag('li', Html::tag('span', $label), $options);
}
return Html::tag('li', Html::a($label, $this->pagination->createUrl($page), ['data-page' => $page]), $options);
$linkOptions = $this->linkOptions;
$linkOptions['data-page'] = $page;
return Html::tag('li', Html::a($label, $this->pagination->createUrl($page), $linkOptions), $options);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment