LoginSignup
1
0

CakePHP5 Paginate 表示件数(limit)を一括設定

Last updated at Posted at 2024-02-15

Cakeのルール的に合ってるのかなぁ。
※おひとりさま開発が多く、私はオレオレフレームワーク大好きな人

で、情報少なく



 ... こうなった。

AppController.php(か、各コントローラが継承しているAppControllerの子クラス)にて

class AdminController extends AppController
{  
    public function initialize(): void
    {
        parent::initialize();
        $this->loadComponent('Authentication.Authentication');

        $this->paginate['maxLimit'] = 500;
        $this->paginate['limit'] = 500;    
    }
}

各コントローラーはこんな感じ

class UsersController extends AdminController
{
    public function index()
    {
        ...
    }
}
1
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
1
0