367 search results for EasyAdmin

// ... lines 1 - 11
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
// ... lines 14 - 20
public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $context): void
{
if (strlen($field->getFormattedValue()) <= self::MAX_LENGTH) {
// ... line 24
}
// ... lines 26 - 29
}
}
See Code Block in Script
// ... lines 1 - 11
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
// ... lines 14 - 20
public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $context): void
{
if (strlen($field->getFormattedValue()) <= self::MAX_LENGTH) {
return;
}
$truncatedValue = u($field->getFormattedValue())
->truncate(self::MAX_LENGTH, '...', false);
$field->setFormattedValue($truncatedValue);
}
}
See Code Block in Script
// ... lines 1 - 11
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
// ... lines 14 - 20
public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $context): void
{
if (strlen($field->getFormattedValue()) <= self::MAX_LENGTH) {
return;
}
$truncatedValue = u($field->getFormattedValue())
->truncate(self::MAX_LENGTH, '...', false);
// ... line 29
}
}
See Code Block in Script
// ... lines 1 - 9
use function Symfony\Component\String\u;
// ... lines 11 - 32
See Code Block in Script
// ... lines 1 - 11
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
// ... lines 14 - 20
public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $context): void
{
if (strlen($field->getFormattedValue()) <= self::MAX_LENGTH) {
return;
}
// ... lines 26 - 29
}
}
See Code Block in Script
// ... lines 1 - 11
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
private const MAX_LENGTH = 25;
// ... lines 15 - 30
}
See Code Block in Script
Override all the Templates

Everything you see in EasyAdmin, from the layout of this table, to even how each individual field is rendered, is controlled by a template. EasyAdmin has a bunch of templates and we can override all of them! We looked ...

6:47
Dashboard Menu Customizations

... / directory. Inside, it has an AdminController with a dashboardAction(). Copy that. Then, in src/AppBundle/Controller/EasyAdmin, open our AdminController and paste it there: Thanks to the prefix on the route import ...

4:02
Assets Custom CSS and JS

The EasyAdmin interface looks pretty great out of the box. But what if we want to customize the way something looks? For example, if I want to change the background on the sidebar. How can we do that? This type of stuff ...

8:17
Configuring Fields

... Open up the "Users" section. EasyAdmin has a concept of fields. A field controls how a property is displayed on the index and detail pages, but also how it renders inside of a form. So the field completely defines the ...

7:01
True Custom Action

... absolutely nothing happens. To make it work, we need to wrap it in a form so that, on click, it submits a POST request to the new action. How can we do that? By leveraging a custom template. We know that EasyAdmin has lots of ...

5:19
Form Panels

... Symfony form type... and then EasyAdmin renders those fields through the form system. It really is that simple. EasyAdmin comes with a custom form theme. So if you wanted to, for example, make a text type field look different ...

6:41
Upload Fields

... whatever the filename is onto the avatar property. Let's add this to our admin area as an "Upload" field and... see if we can get it all working. Fortunately, EasyAdmin makes this pretty easy! It's like it's in the name or ...

7:21
Admin Dashboard

Run: git status Installing EasyAdmin didn't do anything fancy: it doesn't have a recipe that adds config files or a button that makes cute kittens appear. Darn. It just added ...

7:31
Extending with Events

... " feature. Then, no matter where this entity is updated - inside the admin or not - the field would automatically be set to whoever is logged in. But let's see if we can achieve this just inside our EasyAdmin section via ...

8:03
The Filter System

... some criteria, for example, to only show users that are enabled or not enabled. Fortunately, EasyAdmin has a system for this called, well, filters! Over in UserCrudController, I'll go to the bottom and override yet ...

6:40
Overriding Field Templates

... hit Shift + Shift and open up a core class from EasyAdmin called TemplateRegistry.php. If you don't see it, make sure to "Include non-project items". Perfect! Internally, EasyAdmin has many templates and it maintains ...

6:04
The Field Configurator System

... now, I'm using Field which tells EasyAdmin to guess the best field type. This is printing as a textarea... so its field type is really TextareaField... and we can use that if we want to. Here's the new goal: I want to set ...

7:23
... After bin/console assets:install --symlink command everything looks ok but chrome console is shows errors that files are not found GET /bundles/easyadmin/javascript/easyadmin-all.min.js GET /bundles/easyadmin/stylesheet ...
Mykyta Popov
Mykyta Popov
Read Full Comment
Global vs CRUD-Specific Configuration

... It turns out that everything in EasyAdmin is handled by a single giant route. It all runs through the DashboardController route - the /admin route that's above index(): So when we go to QuestionCrudController, it's ...

9:13