我在 cakephp 中有一些代码会产生错误。
这是 PHP Controller :
$this->loadModel( 'Vote' ); //Newly added by amit start
$vote=$this->Vote->getVote($id,$uid);
$this->set('vote',$vote);
$voteCount = count($vote);
$this->set('voteCount',$voteCount);
$voteShow = $this->Vote->find('all', array(
'fields' => array('SUM(Vote.score) AS score','count(id) as countId'),
'conditions'=>array('Vote.type_id'=>$id),
));
$this->set('voteShow',$voteShow);
型号:
public function getVote($id,$uid) {
if (empty($conditions))
$conditions = array('Vote.type' => 'blog',
'Vote.type_id' => $id,
'Vote.user_id' => $uid);
$users = $this->find('all', array('conditions' => $conditions,
'order' => 'Vote.id desc'
));
return $users;
}
该代码产生此错误:
Error : An internal error has occurred
这个错误是什么意思?
最佳答案
我在 core.php 中启用了 Debug模式:Configure::write('debug', 2);
,它解决了我的问题。
关于CakePHP错误: An internal error has occurred,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20303117/