本文整理汇总了PHP中yii\widgets\LinkPager::className方法的典型用法代码示例。如果您正苦于以下问题:PHP LinkPager::className方法的具体用法?PHP LinkPager::className怎么用?PHP LinkPager::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\widgets\LinkPager
的用法示例。
在下文中一共展示了LinkPager::className方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderPager
/**
* Renders the pager.
* @return string the rendering result
*/
public function renderPager()
{
$pagination = $this->dataProvider->getPagination();
if ($pagination === false || $this->dataProvider->getCount() <= 0) {
return '';
}
/* @var $class LinkPager */
$pager = $this->pager;
$class = ArrayHelper::remove($pager, 'class', LinkPager::className());
$pager['pagination'] = $pagination;
$pager['view'] = $this->getView();
return $class::widget($pager);
}
示例2: function
<div class="row col-xs-12" style="margin-bottom:15px">
<?php
echo Html::a(Html::tag('i', '', ['class' => "ace-icon fa fa-plus bigger-120"]) . ' 添加一个公众号', ['create-wechat'], ['class' => 'btn btn-sm btn-primary']);
?>
</div>
<?php
echo \Yii::$app->view->renderFile('@app/views/elements/alert.php', ['msg' => "您还有{$data['leavecount']}个公众号配额,请珍惜使用名额!"]);
?>
<div class="row">
<div class="col-xs-12">
<div class="table-responsive">
<?php
echo GridView::widget(['tableOptions' => ['class' => 'table table-striped table-bordered table-css'], 'dataProvider' => $dataProvider, 'formatter' => ['class' => 'yii\\i18n\\Formatter', 'booleanFormat' => ['×', '√'], 'nullDisplay' => ''], 'layout' => "{items}\n{summary}\n{pager}", 'summary' => '总计:<b>{totalCount}</b>', 'pager' => ['class' => LinkPager::className(), 'options' => ['class' => "pagination pull-right"]], 'columns' => [['attribute' => 'app_name', 'format' => 'raw', 'value' => function ($data) {
$app = Html::img($data->app_logo, ['width' => 100]);
$app .= Html::tag('p', $data->app_name, ['style' => 'margin-top:10px']);
return $app;
}], ['attribute' => 'app_type', 'value' => function ($data) {
$type = '';
switch ($data->app_type) {
case 0:
$type = '代表订阅号';
break;
case 1:
$type = '历史老帐号升级后的订阅号';
break;
case 2:
$type = '服务号';
break;
示例3: function
\$.post(BASE_URL +'/log/modify', data, function(data){
var data = eval('(' + data + ')');
if(data.code) {
alert(data.msg);
} else {
alert('备注修改成功')
window.location.reload();
}
});
}
CHANGE;
$this->registerJs($js_function, View::POS_END);
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'formatter' => ['class' => 'yii\\i18n\\Formatter', 'booleanFormat' => ['×', '√'], 'nullDisplay' => ''], 'layout' => "{items}\n{summary}\n{pager}", 'summary' => '总计:<b>{totalCount}</b>', 'pager' => ['class' => LinkPager::className(), 'options' => ['class' => "pagination pull-right"]], 'columns' => ['type_id', 'type_model', 'type_name', 'type_action', ['attribute' => 'type_active', 'value' => function ($data) {
return $data->type_active == 1 ? '已关闭' : '已开启';
}, 'filter' => Html::dropDownList('OperationTypeSearch[type_active]', $searchModel->type_active, ['' => '所有', 0 => '已开启', 1 => '已关闭'], ['class' => 'form-control'])], ['header' => "操作", 'class' => 'yii\\grid\\ActionColumn', 'template' => '{change} {update}', 'headerOptions' => ['width' => '140'], 'buttons' => ['change' => function ($url, $model, $key) {
switch ($model->type_active) {
case '0':
$link = '关闭';
$action = 'lock';
break;
case '1':
$link = '开启';
$action = 'unlock';
break;
default:
$link = '';
$action = '';
break;
示例4:
<?php
echo Html::a('立即预约', ['/site/order/online-call'], ['class' => 'btn_yuyue', 'rel' => 'nofollow']);
?>
<?php
echo Html::a('给我们留言', ['/site/message/comment'], ['class' => 'btn_liuyan', 'rel' => 'nofollow']);
?>
<?php
echo \frontend\widgets\SideCurrentTop::widget(['title' => '相关话题', 'type' => 'v', 'num' => 6]);
?>
<?php
echo \frontend\widgets\SideImgTop::widget(['title' => '特荐现场', 'short_code' => '', 'type' => 'a', 'num' => 6]);
?>
<?php
echo \frontend\widgets\SideFragment::widget(['short_code' => 'contact_us']);
?>
</div>
<div class="main">
<h2 class="con-title" style="text-align: center;"><?php
echo $this->title;
?>
</h2>
<?php
echo ListView::widget(['dataProvider' => $dataProvider, 'options' => ['class' => 'list-view'], 'itemOptions' => [], 'itemView' => '_item', 'viewParams' => ['columnModel' => $columnModel], 'pager' => ['class' => LinkPager::className(), 'options' => ['class' => 'pagination'], 'nextPageLabel' => '下一页', 'prevPageLabel' => '上一页', 'firstPageLabel' => '首页', 'lastPageLabel' => '末页']]);
?>
</div>
示例5: function
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\LinkPager;
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\search\AuthItemSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Auth Items';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row col-xs-12" style="margin-bottom:15px">
<?php
echo Html::a(Html::tag('i', '', ['class' => "ace-icon fa fa-pencil align-top bigger-125"]) . ' 添加新角色', ['create-role'], ['class' => 'btn btn-sm btn-primary']);
?>
</div>
<div class="auth-item-index">
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'formatter' => ['class' => 'yii\\i18n\\Formatter', 'booleanFormat' => ['×', '√'], 'nullDisplay' => ''], 'layout' => "{items}\n{summary}\n{pager}", 'summary' => '总计:<b>{totalCount}</b>', 'pager' => ['class' => LinkPager::className(), 'options' => ['class' => "pagination pull-right"]], 'columns' => ['name', 'description:ntext', 'created_at', ['header' => "操作", 'class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}', 'headerOptions' => ['width' => '80'], 'buttons' => ['update' => function ($url, $model, $key) {
return Html::a(Html::tag('span', '', ['class' => "glyphicon glyphicon-pencil"]), ['admin/update-role', 'name' => $model->name], ['class' => "btn btn-xs btn-info", 'title' => '修改角色']);
}, 'delete' => function ($url, $model, $key) {
return Html::a(Html::tag('span', '', ['class' => "glyphicon glyphicon-trash"]), ['admin/delete-role', 'name' => $key], ['class' => "btn btn-xs btn-danger", 'title' => '修改角色', 'data-confirm' => '确认删除角色-' . $key]);
}]]]]);
?>
</div>
示例6: function
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\LinkPager;
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\search\ServiceSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Services';
$this->params['breadcrumbs'][] = $this->title;
?>
<p>
<?php
echo Html::a(Html::tag('i', '', ['class' => "ace-icon fa fa-pencil align-top bigger-125"]) . ' 添加新用户', ['create-user'], ['class' => 'btn btn-sm btn-primary']);
?>
</p>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'formatter' => ['class' => 'yii\\i18n\\Formatter', 'booleanFormat' => ['×', '√'], 'nullDisplay' => ''], 'layout' => "{items}\n{summary}\n{pager}", 'summary' => '总计:<b>{totalCount}</b>', 'pager' => ['class' => LinkPager::className(), 'options' => ['class' => "pagination pull-right"]], 'columns' => ['service_id', 'service_username', 'service_fullname', 'service_company', 'service_position', 'service_mobile', 'service_email:email', 'role.item_name', ['header' => "操作", 'class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'headerOptions' => ['width' => '80'], 'buttons' => ['view' => function ($url, $model, $key) {
return Html::a(Html::tag('span', '', ['class' => "glyphicon fa fa-eye"]), ['admin/user-view', 'id' => $key], ['class' => "btn btn-xs btn-success", 'title' => '用户详情']);
}, 'update' => function ($url, $model, $key) {
return Html::a(Html::tag('span', '', ['class' => "glyphicon glyphicon-pencil"]), ['admin/user-update', 'id' => $key], ['class' => "btn btn-xs btn-info", 'title' => '修改']);
}]]]]);