<?php
namespace AdminBundle\Admin\References;
use AdminBundle\Admin\BaseAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollectionInterface;
use Symfony\Component\Form\Extension\Core\Type\TextType;
class FeatureGroupAdmin extends BaseAdmin
{
/**
* @param RouteCollectionInterface $collection
*/
protected function configureRoutes(RouteCollectionInterface $collection): void
{
$collection->remove('view');
}
/**
* @param FormMapper $formMapper
*/
protected function configureFormFields(FormMapper $formMapper): void
{
$formMapper
->with('Название категории', ['class' => 'col-md-6'])
->add('name_ru',TextType::class, ['label' => 'Название группы (RU)', 'required' => false])
->add('name_ua',TextType::class, ['label' => 'Название группы (UA)', 'required' => false])
->end()
;
}
/**
* @param ListMapper $listMapper
*/
protected function configureListFields(ListMapper $listMapper): void
{
$listMapper
->addIdentifier('id')
->add('name_ru',TextType::class, ['label' => 'Имя категории'])
->add('_action', 'actions', [
'label' => 'Действия',
'actions' => [
'edit' => [],
]
])
;
}
}