$.post("http://localhost/academico/materias/getid",
ui.item.value,
function(data){
console.log(data);
}, "json");
私のコントローラーでは、$data
変数は常にnullです。
// $data is always null. How come?
public function getid($data = null) {
debug($data);
// Como vamos a retornar solamente datos, no necesitamos el layout.
$this->layout = null;
$this->set('data', $data);
$this->render('/Elements/ajaxreturn');
}
値POSTを取得して、コントローラーコードで使用できるものにバインドするにはどうすればよいですか?