CakePHP 2.0.4 - findBy magic methods with conditions
问题 I am trying to build a small cms to test CakePHP 2.x In my PagesController (for displaying single sites), I use this code: $page = $this->Page->findByNavtitle($name, array( 'conditions' => array( 'Page.visible' => '1', ), ) ); The result should only set when the record is marked as visible. But this codeblock throws an error. The API describes, that just one parameter is allowed in these findBy magic methods. How can I get the result with conditions? 回答1: You cannot add conditions to findBy