I am using Ajax.
And here is the Ajax-call part of my twig template,
$.post('{{path('acme_member_delScore')}}',
{data1: num }, //I assured that 'num' has right data in javascript
function(response){
if(response.code == 100 && response.success){//dummy check
//do something
console.log(response.id);
}
}, "json");
And my routing.yml contains,
acme_member_delScore:
pattern: /delScore
defaults: { _controller: AcmeMemberBundle:Default:delScore}
While the action in my Controller is defined as follow,
public function delScoreAction()
{
$request = $this->container->get('request');
$id = $request->query->get('data1');// but $id is null
// ...
Do you have any idea why my $id variable (in delScoreAction) is always set to null?
Is there anything I have to check?