Closed xgendrea closed 5 years ago
With Controller instead of AbstractController, it works. I close the issue
Controller is deprecated so why we should use it instead AbstractController?
@cierzniak indeed, if you want to access to the service grid directly, you mus sur Controller, which is not a best practice.
To have acces to a grid and use AbstractController, you can use the following code :
<?php
...
use APY\DataGridBundle\Grid\GridManager;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
...
class CourseController extends AbstractController
{
public function index(GridManager $gridManager): Response
{
$grid = $gridManager->createGrid();
....
}
}
Hope this helps.
Hi all,
I installed Symfony 4.2.5 and lastest stable version from APY DataGrid Bundle and I just create an Entity called Child like this :
Then I created a controller :
And when I test it I have following issue :
ServiceNotFoundException Service "grid" not found: even though it exists in the app's container, the container inside "App\Controller\Web\ChildrenController" is a smaller service locator that only knows about the "doctrine", "form.factory", "http_kernel", "parameter_bag", "request_stack", "router", "security.authorization_checker", "security.csrf.token_manager", "security.token_storage", "serializer", "session", "templating" and "twig" services. Try using dependency injection instead.
Could you check what happens ?
Thanks