-1
$.post("http://localhost/academico/materias/getid",
ui.item.value,
function(data){
console.log(data);
}, "json");
在我控制的變量$data
變量總是空:數據POST'd蛋糕控制器沒有被綁定到功能
// $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'd的值綁定到我可以在Controller代碼中使用的東西?
debug($ this-> data); –
@MoyedAnsari:剛剛返回'array()'。 – sergserg
does console.log(數據)顯示的東西? –