Я довольно новичок в CakePHP, и я хочу знать, как статически идентифицировать идентификатор в раскрывающемся списке или списке.Я сделал скрытый, но его не войти в базу данных.Это моя кодировка:
Это в контроллере
function add() {
if (!empty($this->data)) {
$this->Post->create();
if ($this->Post->save($this->data)) {
$this->Session->setFlash(__('The post has been saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The post could not be saved. Please, try again.', true));
}
}
$users = $this->Post->User->find('list');
$this->set(compact('users'));
$this->set('userid',$this->Auth->user('id'));
}
эта кодировка находится в ctp
<?php
echo $this->Form->input('user_id');
?>