33 lines
916 B
PHP
33 lines
916 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Controller\Admin;
|
||
|
|
||
|
use App\Entity\Blog;
|
||
|
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
|
||
|
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
|
||
|
use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField;
|
||
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;
|
||
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
|
||
|
|
||
|
class BlogCrudController extends AbstractCrudController
|
||
|
{
|
||
|
public static function getEntityFqcn(): string
|
||
|
{
|
||
|
return Blog::class;
|
||
|
}
|
||
|
|
||
|
public function configureFields(string $pageName): iterable
|
||
|
{
|
||
|
return [
|
||
|
AssociationField::new('author')
|
||
|
->autocomplete(),
|
||
|
TextField::new('title'),
|
||
|
TextEditorField::new('teaser'),
|
||
|
TextEditorField::new('content'),
|
||
|
DateTimeField::new('createdAt'),
|
||
|
AssociationField::new('editedBy')
|
||
|
->autocomplete()
|
||
|
];
|
||
|
}
|
||
|
}
|