Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Added aliases for Symfony4 service autowiring #922

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

romaricdrigon
Copy link

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,
      ));
    }
}

pokurek added a commit to RedWeb/DatatablesBundle that referenced this pull request Jan 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symfony 4.2 DI issue
1 participant