Home  >  Article  >  Backend Development  >  zend framework控制器点击交付 指定的网页无法访问 测试获取表单的数组能够正常输出 表模型也没错

zend framework控制器点击交付 指定的网页无法访问 测试获取表单的数组能够正常输出 表模型也没错

WBOY
WBOYOriginal
2016-06-13 11:04:07702browse

zend framework控制器点击提交 指定的网页无法访问 测试获取表单的数组能够正常输出 表模型也没错


点击提交后
您指定的网页无法访问! 
错误类型:500

控制器代码
public  function additemAction(){
       $name=$this->getRequest()->getParam('name');
   $description=$this->getRequest()->getParam('description');
   $vote_count=$this->getRequest()->getParam('vote_count');
  
/*      
    echo  $name,$description,$vote_count;
  
   exit();*/
  
  
   $data=array(
           'name'=>$name,
          'description'=>$description,
        'vote_count'=>$vote_count
   );
  
 
   $itemModel=new Item();
   $itemModel->insert($data);
          $this->redirect('ok');
  }



Item.php

//这里必须继承Zend_Db_Table,否则就不是表模型
class  Item extends  Zend_Db_Table{
//默认主键为id  可以不写
    protected   $_primary='id';
protected  $_name='item';


}
------解决方案--------------------
你数据库有没有配置的?
------解决方案--------------------
"指定的网页无法访问"是不是提交的路径有问题呢?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn