我是练习 CakePHP 的新手,我想从网络用户那里获取价值,我的控制器将从数据库中搜索该值。我只是想知道如何将我的 $_post 值添加到以下代码中?
class DataviewsController extends AppController {
public $components = array('RequestHandler');
public function customer($id = null) {
$this->loadModel('Customer','Stock');
if (!$this->Customer->exists($id)) {
throw new NotFoundException(__('Invalid customer'));
}
$options = array('conditions' => array('Customer.' . $this->Customer->primaryKey => $id));
// Send the customer to the view
$this->set('customer', $this->Customer->find('first', $options));
$this->set('_serialize',array('customer'));
}