EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

An exception has been thrown during the rendering of a template ("Call to a member function getI18n() on null").

Open Anoob007 opened this issue 11 months ago • 2 comments

An exception has been thrown during the rendering of a template ("Call to a member function getI18n() on null").

`{# templates/bundles/EasyAdminBundle/layout.html.twig #} {% extends '@EasyAdmin/layout.html.twig' %}

{% block content_title %}Set Delivery Zone{% endblock %}

{% block main %}

Use the map below to draw a delivery zone and save it.

{% endblock %} `

Anoob007 avatar Mar 21 '25 16:03 Anoob007

Had a similar problem. Looks like AdminContext is not defined. You can try my solution #6843

chestaxd avatar Mar 23 '25 15:03 chestaxd

@Anoob007 : you need to

  • {% extends '@EasyAdmin/page/content.html.twig' %}
  • <a href="{{ ea_url().setRoute('app_your_route_name') }}">Content</a> for accessing your custom url

@chestaxd : i think he is talking about https://symfony.com/bundles/EasyAdminBundle/current/actions.html#integrating-symfony-actions (ugly urls) instead of https://symfony.com/bundles/EasyAdminBundle/current/actions.html#adding-custom-actions (can be pretty urls)

pfpro avatar Mar 23 '25 20:03 pfpro