Hey,
I am trying to optimise a couple of cakephp controllers with some additional methods in the model but am getting a 500 Internal Server error returned. Can anyone point me in the right direction please?
Model:
function getID($id) {
$tmp = $this->find("all",array('conditions'=>array('Model.id'=>$id)));
return $tmp;
}
Controller:
function getTotalQuestions(){
$tmp=$this->Model->getID(7);
debug($tmp);
}
Occasionally I don’t get a 500 error, but an error message telling me no variable has been passed to getID.
Any help would be greatly appreciated
Taff
It is how you are wording your functions (most likely). You need to change the format of the function names:
Take a look at http://book.cakephp.org/view/908/Requirements#!/view/904/Controller-Conventions for more details. But it states: