When using AJAX prototype function symfony generate callback function with prototype:
function(request):
but the prototype 1.4 is said to parse the request header for 'X-JSON' and automatically evaluate it and return it has a second parameter to the callback function. Therefore we should now take this into account by modifying the JavascripHelper?.php to:
function _build_callbacks($options)
{
$callbacks = array();
foreach (get_callbacks() as $callback)
{
if (isset($options[$callback]))
{
$name = 'on'.ucfirst($callback);
$code = $options[$callback];
$callbacks[$name] = 'function(request, json){'.$code.'}';
}
}
just adding the ",json" does the trick. then in you view template output:
<?php //$sf_context->getResponse()->setHttpHeader("X-JSON", '('.$value')'); ?>
makes it works with json prototype implementation.
Thanks.