2014-10-12 1 views

답변

1

당신은 다음과 같이 처리 할 수 ​​

ajaxUrl 컨트롤러/액션 컨트롤러

public function action(){ 
    $this->autoRender = false; 
    $this->request->onlyAllow('ajax'); 

    $input = $_POST["input1"]; 

    //Do the Database Input here 

    return Suceess/Failure; 

}

에서 다음

$.ajax({ 
    type : "post", 
    url : ajaxUrl 
    data: {"input1" : $("input[name='text-box']").val()} 

}).done(function(data){ 
    console.log(data); 
}); 

관련 문제