ZEND FRAMEWORK的进来帮忙看下 哪里错了
我的MODEL的代码
我是想用testTages来判断标签的名字是否存在,如果存在的话updatelogNum不存在的话insertTag可是报错。。。。。。
public function testTags($tags)//------判断标签是否存在
{
$name = $this->find($tags)->toArray();
if(!$name)
{
return false;
}
}
public function updatelogNum($tags)//------更新标签的文章数
{
$db = $this->getAdapter();
$where = $db->quoteInto('name = ?', $tags);
$arr = array('logNum' => new Zend_Db_Expr('logNum + 1'));
return $this->update($arr, $where);
}
public function insertTag($data)//插入新的标签
{
$db = $this->getAdapter();
$this->insert($data);
return $db->lastInsertId();
}
我的控制器的里的判断
$data1=array(
'name'=>$tags,
);
if($tag->testTags($tags))
{
$tag->updatelogNum($tags);
}
else
{
$tag->insertTag($data1);
}
帮帮忙看我哪里写错了 还是我逻辑错了。还是函数用错了。
错误信息
[code]Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in C:\wamp\www\blog\library\Zend\Controller\Dispatcher\Standard.php:242 Stack trace: #0 C:\wamp\www\blog\library\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 C:\wamp\www\blog\index.php(30): Zend_Controller_Front->dispatch() #2 {main} thrown in C:\wamp\www\blog\library\Zend\Controller\Dispatcher\Standard.php on line 242