zend框架从空值创建默认对象

时间:2017-11-11 16:04:11

标签: php zend-framework

我试图修改代码,当我提交表单时我得到这个错误"从空值"创建默认对象。我在$ request->中制作了n个echo参数; isPost没有回显。这是我的代码

public function addAction() {


            $report = new Report();
    $request = $this->getRequest ();
    $validateOnly = $request->isXmlHttpRequest ();
    if ($validateOnly)
    $this->setNoRenderer ();

    $userObj = new User ( );
    $userRow = $userObj->createRow();

    $status = ValidationContainer::instance ();
    $userArray = $userRow->toArray ();
    $userArray['acls'] = User::getACLs ( $user_id ); //set acls
    $this->viewAssignEscaped ( 'user', $userArray );

            $locations = Location::getAll();
    $this->viewAssignEscaped('locations', $locations);
            //var_dump($locations); exit;

    if ($request->isPost()) {

            self::fillFromArray ( $userRow, $details );

            $userRow->is_blocked = 0;
            if ($id = $userRow->save ()) {

                  in the provider_code table.
                                    $this->insertPlainPassword($this->getSanParam('password'), $id);

                $status->setStatusMessage ( 'The new user was created.' );
                $this->saveAclCheckboxes ( $id );
            } else {
                $status->setStatusMessage ( 'The user could not be saved.' );
            }

        }
    }


}

我一直试图解决它好几周了。     }

0 个答案:

没有答案