我无法在编辑表单中看到控制器操作中的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) {
}
}
任何人都可以知道它为什么没有显示???