LoginSignup
3
3

More than 5 years have passed since last update.

CakePHP - CakeDC searchプラグインではまったこと

Posted at

CakeDCのsearchプラグインを使おうと思い、サンプルに合わせて記述していったら下記のようなエラーになったので回避方法メモ。

Notice (8): Indirect modification of overloaded property ArticlesController::$paginate has no effect

readmeのサンプルでは下記のように書けと書いてある。

public function find() {
  $this->Prg->commonProcess();
  $this->paginate['conditions'] = $this->Article->parseCriteria($this->Prg->parsedParams());
  $this->set('articles', $this->paginate());
}

$this->paginate['condition']という書き方をやめて直接paginate()の変数に渡すことで解決した。

public function find() {
  $this->Prg->commonProcess();
  $this->set('articles', $this->paginate($this->Article->parseCriteria($this->Prg->parsedParams())));
}
3
3
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
3
3