PHP code example of tourze / easy-admin-enum-field-bundle
1. Go to this page and download the library: Download tourze/easy-admin-enum-field-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tourze / easy-admin-enum-field-bundle example snippets
use Tourze\EasyAdminEnumFieldBundle\Field\EnumField;
use App\Entity\StatusEnum;
// In your EasyAdmin CrudController
public function configureFields(string $pageName): iterable
{
yield EnumField::new('status')
->setEnumCases(StatusEnum::cases())
->renderAsBadges();
}