0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

CakePHP4(3)で表示件数を変更するUI

Posted at

limitのコントローラーでの変更やテンプレートの書き方の記述はいくつかあったけど、CakePHPの標準機能を使った方法が無かったの書いておきます。
image.png

<?php
     echo $this->Paginator->limitControl(
        [
            25 => "25件",
            50 => '50件',
            100 => '100件'
        ],
            25,
        ['label'=>'表示件数:']
    );
 ?>

第二引数のデフォルトの表示件数は個人的にはcontroller側で指定した方が無難な気がします。

image.png
https://book.cakephp.org/4/ja/views/helpers/paginator.html

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?