Jean-Pierre Mena
Jean-Pierre Mena

Reputation: 141

Easy Admin does not show the relationships

Upvotes: 1

Views: 1369

Answers (1)

Hamid ER-REMLI
Hamid ER-REMLI

Reputation: 210

I was also stuck in this step for the same reason !! But I found the solution in this link

In sum, at Admin/CommentCrudController.php, you should add this:

use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;

and override function configureFields like this:

public function configureFields(string $pageName): iterable
{
    return [
        FormField::addPanel('Conference'),
        AssociationField::new('conference')
            ->setRequired(true)
            ->setHelp('help text'),
        FormField::addPanel('Comment'),
        TextField::new('author')
            ->setHelp('Your name'),
        TextEditorField::new('text', 'Comment')
            ->setHelp('help text'),
        EmailField::new('email', 'Email Address')
            ->setHelp('Your valid email address'),
        DateTimeField::new('createdAt'),
        TextField::new('photoFilename')
    ];

}

Now, it should work fine as for me :-)

Upvotes: 6

Related Questions