I use Symfony3 with PhpStorm.2016.3.2 on Ubuntu16.04
I never done an AJAX request before and would like to test a call to controller from a view->to the controller->that sends an answer back to the view in JSON.
So I read on the doc but they are all very specific. So my desire is to only being able to write a simple AJAX request in a view(index.html.twig),for testing it, make a call to the controller(MainController.php) and return the answer in JSON in the view.
This is my view:
{% extends 'app/layout.html.twig' %}
{% block content %}
{% endblock %}
My controller:
class MainController extends Controller
{
public function indexAction()
{
return $this->render('app/main/index.html.twig');
}
}
I really don't want to make the job done by the others, I just want to get a hint of how to make it work. So I'm sorry if my ticket is rather empty but maybe it can help others too, like me, to know where to start off.