2017-02-21 8 views
0

私は同じアクションでページ作成を複数回使用してcakedc検索を使用するコントローラでアクションを実行します。私の中でCakephpとアクション内でのページネートの複数の使用

$this->Paginator->settings['limit'] = 50; 
$this->Paginator->settings['maxlimit'] = 50; 
$this->set('uuser', $this->paginate()); 
$this->Paginator->settings['limit'] = 1000; 
$this->Paginator->settings['maxlimit'] = 1000; 
$this->set('maxusers',$this->paginate()); 

:ここで使用したコードイムの例だ最初のページネーションにおける iは50の制限とMAXLIMITを使用したい2つ目に、私は1000 の制限とMAXLIMITを使用したいですページはuuserだけを使用していますが、問題は制限がかかり、maxlimitが1000ではなく50になります。 uuser変数には制限があり、maxlimitページングは​​50、maxusersには制限がありますmaxusersはセッション変数に格納されていますので、index.ctpページでは使用しません。ここで

おかげ

+1

あなたの質問は何ですか? – FeedTheWeb

答えて

0

はあなたが

コールコンポーネントpagination.ctp要素にこのコードを入れて、この

<div class="paging" style=" background: none repeat scroll 0 0 #60C8F2; 
    float: right; 
    padding: 0 10px; 
    text-align: left; 
    width: auto;"> 
<?php 
$this->Paginator->options(array(
    'url' => array_merge(array(
     'controller' => $this->params['controller'], 
     'action' => $this->params['action'], 
    ) , $this->params['pass'], $this->params['named']) 
)); 

echo $this->Paginator->prev('' . '' , array(
    'class' => 'prev', 
    'escape' => false 
) , null, array(
    'tag' => 'span', 
    'escape' => false, 
    'class' => 'prev' 
)), "\n"; 
echo $this->Paginator->numbers(array(
    'modulus' => 2, 
    'skip' => '', 
    'separator' => " \n", 
    'before' => null, 
    'after' => null, 
    'escape' => false 
)); 
echo $this->Paginator->next('' . '', array(
    'class' => 'next', 
    'escape' => false 
) , null, array(
    'tag' => 'span', 
    'escape' => false, 
    'class' => 'next' 
)), "\n"; 
?> 
</div> 

のように独自のカスタムページネーションを追加ページネーションの一例ですコントローラ内

var $components = array('Paginator'); 

コールあなたのコントローラ

$this->paginate = array(
      'limit' => 10, 
      'order' => array(
      'User.created' => 'desc') 

     ); 
     $results = $this->paginate('User'); 

そして、CTPファイル中に改ページが改ページを呼び出す

<?php echo $this->element('pagination'); ?> 
関連する問題