自动验证正常 自动完成 失败什么原因呢

浏览:469 发布日期:2014/03/25 分类:求助交流
数据库是XXX_show
AddAction.php$Form   =   D('Add');
        if($Form->create()) {
            $result = D('Show')->data($data)->add();
            if($result) {
                $this->success('添加成功!');
            }else{
                $this->error('添加错误!');
            }
        }else{
            $this->error($Form->getError());
        }
AddModel.class.phpclass AddModel extends Model {
    // 定义自动验证
    protected $_validate    =   array(
        array('imgurl','require','请填写信息,'),
        );
    // 定义自动完成
    protected $_auto    =   array(
        array('showtime','time',1,'function'),
        array('ip','get_client_ip',1,'function')
    );
}
最佳答案
评论( 相关
后面还有条评论,点击查看>>