我正在将CakePHP 1.2网站转换为1.3并运行一些问题。由于Model :: findAll已在1.3中删除,我该如何转换这段代码?
$pages = $this->Page->findAll("category like '{$page['Page']['category']}'",null,'sort_order');
答案 0 :(得分:2)
应该更像是
$pages = $this->Page->find('all', array(
'conditions' => array('category LIKE' => $page['Page']['category']),
'order'=>array(...),
'fields'=>array(...)
));
答案 1 :(得分:-1)
我认为它是这样的。
$pages = $this->Page->find('all', array('conditions' => array('category like ' => '{$page['Page']['category']})));