我正在使用Cake PHP 2分页在我的视图中生成链接。我所在的页面URL是:
当我想在我的页面中向前导航时,Cake添加了一个url
编码值,表示我当前的页面路径:payday_admin/leads
到我的URL,沿着limit
选项。这两个我都不需要,我只需要page
号码。
如何禁用此功能?
它看起来是这样的:
下面是我的视图标记:
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-end mb-0">
<?php
echo $this->Paginator->prev('Prev', array('tag' => 'li', 'class'=>'page-item', ' class'=>'page-link'), null, array('class' => 'disabled page-item', 'tag' => 'li', 'disabledTag' => 'a', ' class' =>'page-link'));
echo $this->Paginator->numbers(array('separator' => '', 'currentTag' => 'a', 'tag' => 'li', 'class'=>'page-item', 'currentClass' => 'disabled bg-primary text-white page-link', ' class'=>'page-link','modulus'=>6));
echo $this->Paginator->next('Next', array('tag' => 'li', 'class'=>'page-item', ' class'=>'page-link'), null, array('class' => 'disabled page-item', 'tag' => 'li', 'disabledTag' => 'a', 'currentClass'=>'page-link', ' class' =>'page-link'));
?>
</ul>
</nav>
我的控制器...
// define pagination settings
$this->Paginator->settings = array(
'Application' => array(
'paramType' => 'querystring',
'totalLimit' => 20000,
'limit' => 20000,
'maxLimit' => $filters['pagination']['perPage'],
'fields' => array(
'Application.*',
'ApplicationPayday.*',
'ApplicationApiLink.*',
'ApplicationResponse.*',
'AffiliateId.*',
'Redirect.*'
),
'joins' => array(
array(
'table' => 'tlp_application_paydays',
'alias' => 'ApplicationPayday',
'type' => 'LEFT',
'conditions' => array(
'ApplicationPayday.application_id = Application.id'
)
),
array(
'table' => 'tlp_application_api_links',
'alias' => 'ApplicationApiLink',
'type' => 'LEFT',
'conditions' => array(
'ApplicationApiLink.application_id = Application.id'
)
),
array(
'table' => 'tlp_application_responses',
'alias' => 'ApplicationResponse',
'type' => 'LEFT',
'conditions' => array(
'ApplicationResponse.application_id = Application.id'
)
),
array(
'table' => 'tlp_affiliate_ids',
'alias' => 'AffiliateId',
'type' => 'LEFT',
'conditions' => array(
'AffiliateId.aff_id = Application.tlp_aff_id'
)
),
array(
'table' => 'tlp_redirects',
'alias' => 'Redirect',
'type' => 'LEFT',
'conditions' => array(
'Redirect.application_id = Application.id'
)
)
),
'conditions' => array(
'Application.modified_timestamp >=' => $initialStartDate,
'Application.modified_timestamp <=' => $initialEndDate
),
'group' => array(
'Application.id'
),
'order' => array(
'Application.id' => 'desc'
),
'recursive' => -1
)
);
// run query to get applications via paginated settings
$applications = $this->Paginator->paginate('Application');
我只需要:
1条答案
按热度按时间ie3xauqp1#
添加参数是因为Paginator设置中的'paramType' =〉'querystring'。如果您删除它并手动创建路由,请使用如下命名参数:
您的URL将更干净:
/payday_admin/潜在客户/页面:1,/payday_admin/潜在客户/页面:2