Initialize a CRUD for entities

This commit is contained in:
2019-11-19 09:32:33 +01:00
parent dc1bac05ee
commit 4575812a3b
11 changed files with 533 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Entity\Country;
use Chill\MainBundle\Pagination\PaginatorFactory;
/**
*
*
*/
class AdminCountryCRUDController extends CRUDController
{
function __construct(PaginatorFactory $paginator)
{
$this->paginatorFactory = $paginator;
}
protected function getEntity(): string
{
return Country::class;
}
protected function orderingOptions(): array
{
return [
'countryCode' => 'ASC'
];
}
protected function getTemplateParameters($action): array
{
switch ($action) {
case 'index':
return [
'columns' => [ 'countryCode', 'name' ],
'title' => 'Liste des pays'
];
}
}
}