ExampleBundle_loadData:
pattern: /data.{_format}/{type}/{params}
defaults: { _controller: ExampleBundle:Default:loadData, _format:json }
requirements: { _format: json|xml }
public function loadDataAction($type, $params)
{
$return = array('type'=>$type,'params'=>$params);
return $this->render('ExampleBundle:Default:ajax.json.twig', array('data'=>$return));
}
{{data|json_encode|raw}}