DatatablesBundle
DatatablesBundle copied to clipboard
Added aliases for Symfony4 service autowiring
Hello,
This PR adds some aliases so Symfony4 autowiring works out of the box. Still it keep old service names, so there's no BC break.
It fixes #857
Example of autowiring :
class MyController extends AbstractController
{
/**
* @Route("/test", name="test_index")
*/
public function index(DatatableFactory $factory, DatatableResponse $datatableResponse, Request $request)
{
$datatable = $factory->create(PostDatatable::class);
$datatable->buildDatatable();
if ($request->isXmlHttpRequest()) {
$datatableResponse->setDatatable($datatable);
$datatableResponse->getDatatableQueryBuilder();
return $datatableResponse->getResponse();
}
return $this->render('post/index.html.twig', array(
'datatable' => $datatable,
));
}
}