Skip to content

Commit

Permalink
feature #2 Added some filters in the Blog Post section
Browse files Browse the repository at this point in the history
Added some filters in the Blog Post section
  • Loading branch information
javiereguiluz authored Jul 27, 2021
2 parents d08a4e7 + 618e17e commit 2cef4bf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Controller/EasyAdmin/PostCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use EasyCorp\Bundle\EasyAdminBundle\Config\Action;
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use EasyCorp\Bundle\EasyAdminBundle\Config\Filters;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
use EasyCorp\Bundle\EasyAdminBundle\Field\CodeEditorField;
Expand Down Expand Up @@ -33,6 +34,15 @@ public function configureActions(Actions $actions): Actions
->remove(Crud::PAGE_INDEX, Action::DELETE);
}

public function configureFilters(Filters $filters): Filters
{
return $filters
->add('title')
->add('author')
->add('publishedAt')
;
}

public function configureFields(string $pageName): iterable
{
yield TextField::new('title');
Expand Down

0 comments on commit 2cef4bf

Please sign in to comment.