597 search results

Permissions

…problem. Though, at the very least, a user wouldn't be able to guess the URL, because EasyAdmin generates a signature. That's this signature=" part. What that does is prevent anyone from messing with a URL and trying to access something else. For example…

6:35
Lightning Talks

…etc. La configuration des classes Admin est assez exhaustive, mais permet de faire beaucoup de personnalisation EasyAdmin La config est en Yaml, pas de classes Admin Autocomplete pour les relations et les ChoiceType Chaque entité peut avoir son propre contrôleur Timecode: 33:03 symfony est…

49:48
Dashboard & Menu Customizations

…an error! That was not the dramatic success moment I was hoping for. But... look! It did redirect to /easyadmin/dashboard! The error is just a Ryan mistake: I forgot a use statement for my Genus class. Add that on top: Try it again! Hello…

4:02
Installation and First Admin

…this thing installed. Copy the composer require line, go back to your terminal, open a new tab, and paste: composer require javiereguiluz/easyadmin-bundle While Jordi is downloading that package, let's keep busy! Copy the new bundle line, find app/AppKernel.php, and put…

5:56
Form Theming For a Completely Custom Field

…or _genus_genusScientists_widget. The last block would only affect this one field. Copy that name. Then, in app/Resources/views/easy_admin, create a new file called _form_theme.html.twig. Add the block: _genus_genusScientists_widget with its endblock: Are you feeling powerful…

8:52
Adding a Custom Action

…and name="genus_feed to match what we put in the config: Notice the URL for this is just /genus/feed. It does not start with /easyadmin. And so, it's not protected by our access_control security. That should be enough to get started…

10:32
Override Controllers

…that... we're going to do something completely different. Instead of having one controller - AdminController - full of entity-specific hook methods like preUpdateUserEntity or createGenusEditForm - I prefer to create a custom controller class for each entity. Try this: in the EasyAdmin directory, copy AdminController and…

7:11
CSV Export

…inside, a link with btn btn-primary and an href. How can we point to the exportAction()? Remember, the bundle only has one route: easyadmin. For the parameters, use a special variable called _request_parameters. This is something that EasyAdminBundle gives us, and it contains…

11:48
The Autocomplete Field

…load... which will really slow - or even break - your page. Let's use the autocomplete field instead. Expand the subFamily configuration and set type: easyadmin_autocomplete: That is all we need: it will look at the subFamily field and know which entity to query. So...…

1:50
Custom Stimulus JavaScript Controller

…need to set a few attributes. The first is row_attr: the attributes that you want to add to the form "row". This is not an Easy Admin thing... it's a normal option inside Symfony's form system. Add a data-controller attribute set…

6:20
AssociationField for a "Many" Collection

…but you get the idea. Hit save and... nice! Next, let's dig into the powerful Field Configurators system where you can modify something about every field in the system from one place. It's also key to understanding how the core of EasyAdmin works.

6:28
Adding More Customized Blocks

…the layout to get back to the main page. If you go to /admin, you'll find that our app already has EasyAdmin installed. Let's add a link from the menu here to Layouts to make life easier. Open src/Controller/Admin/DashboardController.php..…

5:16
configureCrud()

…yea! That looks better. Next: I want to talk about using a what-you-see-is-what-you-get editor. There's actually a simple one built into Easy Admin. But we're going to go further and install our own. Doing that will require…

5:38
EasyAdminBundle v1 for an Amazing Admin Interface

Time to build an admin interface for your amazing site! You want it to be great! Powerful! Beautiful! Awe-inspiring! ... and you need to be able to finish it in a just a few hours! Lucky you. EasyAdminBundle allows you to spin up fully-featured…

23 videos
|
2:26:29
17 lines | src/EasyAdmin/VotesField.php
// ... lines 1 - 4
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
// ... lines 6 - 7
class VotesField implements FieldInterface
{
use FieldTrait;
// ... lines 11 - 15
}
See Code Block in Script
17 lines | src/EasyAdmin/VotesField.php
// ... lines 1 - 7
class VotesField implements FieldInterface
{
// ... lines 10 - 11
public static function new(string $propertyName, ?string $label = null)
{
// TODO: Implement new() method.
}
}
See Code Block in Script
24 lines | src/EasyAdmin/VotesField.php
// ... lines 1 - 6
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
// ... line 8
class VotesField implements FieldInterface
{
// ... lines 11 - 12
public static function new(string $propertyName, ?string $label = null)
{
return (new self())
->setProperty($propertyName)
->setLabel($label)
->setTemplateName('crud/field/integer')
->setFormType(IntegerType::class)
->addCssClass('field-integer')
->setDefaultColumns('col-md-4 col-xxl-3');
}
}
See Code Block in Script
27 lines | src/EasyAdmin/VotesField.php
// ... lines 1 - 12
public static function new(string $propertyName, ?string $label = null)
{
return (new self())
// ... lines 16 - 17
// this template is used in 'index' and 'detail' pages
->setTemplatePath('admin/field/votes.html.twig')
// this is used in 'edit' and 'new' pages to edit the field contents
// you can use your own form types too
->setFormType(IntegerType::class)
// ... lines 23 - 24
}
}
See Code Block in Script
// ... lines 1 - 2
namespace App\EasyAdmin;
// ... lines 4 - 5
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldConfiguratorInterface;
// ... lines 7 - 10
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
// ... lines 13 - 21
}
See Code Block in Script
// ... lines 1 - 4
use EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext;
// ... line 6
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto;
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto;
// ... lines 9 - 10
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
public function supports(FieldDto $field, EntityDto $entityDto): bool
{
// ... line 15
}
public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $context): void
{
// ... line 20
}
}
See Code Block in Script