I am using the Zend Framework 2 and would like to pass a variable from my action to javascript.
Controller Code:
fooAction
{
return 'bar'
}
JavaScript Code
$.post('foo', { week: week, day: day, time: time }, function(data) { $(id).html(data); });
I would like to pass the value 'bar' back to javascript. Currently if I do something like the below I get the correct results. I would like to use a variable from the action instead of hard keying it.
$.post('foo', { week: week, day: day, time: time }, function(data) { $(id).html('bar'); });
Many Thanks, Matt