0

我无法在编辑表单中看到控制器操作中的 ID 值。它显示出这样的东西..

<form action="/XXProj/userpages/edit" class="form-horizontal" id="UserpageEditForm" enctype="multipart/form-data" method="post" accept-charset="utf-8"><div style="display:none;"><input type="hidden" name="_method" value="POST"/></div>

这是我的控制器功能..

 <?php error_reporting(0);
   class UserpagesController extends AppController {
     public $helpers = array("Html", "Form","Session");
       public $uses = array('Userpage','Usergroup');

public function index() {
}

    public function edit($id = null) {
    $this->Userpage->id = $id;
    $this->set("userpages", $this->Userpage->read());
    pr($this->Userpage->read());
    if ($this->request->is("get")) {
        $this->request->data = $this->Userpage->read();
    } else {
        if ($this->Userpage->save($this->request->data)) {
            $this->Session->setFlash("updated.");
            $this->redirect(array("action" => "index"));
        } else {
            $this->Session->setFlash("Unable to update.");
        }
    }
}

public function delete($id = null) {
}
}

任何人都可以知道为什么它没有显示???

4

0 回答 0