forked from EasyCorp/EasyAdminBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlogPostCrudController.php
More file actions
39 lines (34 loc) · 1.09 KB
/
BlogPostCrudController.php
File metadata and controls
39 lines (34 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
namespace EasyCorp\Bundle\EasyAdminBundle\Tests\TestApplication\Controller;
use EasyCorp\Bundle\EasyAdminBundle\Config\Filters;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
use EasyCorp\Bundle\EasyAdminBundle\Field\BooleanField;
use EasyCorp\Bundle\EasyAdminBundle\Field\IdField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use EasyCorp\Bundle\EasyAdminBundle\Tests\TestApplication\Entity\BlogPost;
/**
* @extends AbstractCrudController<BlogPost>
*/
class BlogPostCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string
{
return BlogPost::class;
}
public function configureFields(string $pageName): iterable
{
return [
IdField::new('id')->hideOnForm(),
TextField::new('title'),
TextField::new('slug'),
BooleanField::new('content'),
BooleanField::new('author'),
];
}
public function configureFilters(Filters $filters): Filters
{
return $filters
->add('title')
->add('author');
}
}