Your project controllers should only contains actions as public methods 2
- Read doc
- Productivity
- Major
More information: https://insight.symfony.com/what-we-analyse/symfony.controller.non_action_public_method_in_controller_class
- use EasyCorp\Bundle\EasyAdminBundle\Field\IdField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
- abstract class CountryCrudController extends AbstractCrudController
- {
- public function configureCrud(Crud $crud): Crud
- {
- return $crud
- ->setEntityLabelInSingular('enabel_partner_countries.admin.menu.country')
- ->setEntityLabelInPlural('enabel_partner_countries.admin.menu.countries')
- ->setPageTitle('index', '%entity_label_plural%')
- }
- /**
- * @return iterable<FieldInterface>
- */
- public function configureFields(string $pageName): iterable
- {
- $id = IdField::new('id', 'enabel_partner_countries.admin.form.id');
- $country = CountryField::new('alpha2code', 'enabel_partner_countries.admin.form.country');
- $code2 = TextField::new('alpha2code', 'enabel_partner_countries.admin.form.alpha2code');
- $code3 = TextField::new('alpha3code', 'enabel_partner_countries.admin.form.alpha3code');
damienlagae
=> because EasyAdmin