Fix adding quick menus to list_with_period.html.twig

- update twig namespaces
- move twig file within Resources
This commit is contained in:
2024-06-13 11:47:07 +02:00
parent d60ba3ecb2
commit cc0030c1cd
4 changed files with 17 additions and 29 deletions

View File

@@ -1,11 +1,11 @@
{% if menus|length > 0 %}
<li class="dropdown">
<a class="dropdown-toggle btn btn-sm btn-create"
<a class="dropdown-toggle btn btn-sm btn-outline-primary"
href="#"
role="button"
data-bs-toggle="dropdown"
aria-expanded="false">
{{ 'Create'|trans }}
<i class="fa fa-flash"></i>
</a>
<div class="dropdown-menu">
{% for menu in menus %}

View File

@@ -11,8 +11,6 @@ declare(strict_types=1);
namespace Chill\MainBundle\Routing;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Twig\Environment;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
@@ -20,10 +18,8 @@ use Twig\TwigFunction;
/**
* Add the filter 'chill_menu'.
*/
class MenuTwig extends AbstractExtension implements ContainerAwareInterface
class MenuTwig extends AbstractExtension
{
private ?ContainerInterface $container = null;
/**
* the default parameters for chillMenu.
*
@@ -86,9 +82,4 @@ class MenuTwig extends AbstractExtension implements ContainerAwareInterface
{
return 'chill_menu';
}
public function setContainer(?ContainerInterface $container = null)
{
$this->container = $container;
}
}

View File

@@ -20,9 +20,5 @@ services:
chill.main.twig.chill_menu:
class: Chill\MainBundle\Routing\MenuTwig
arguments:
- "@chill.main.menu_composer"
calls:
- [setContainer, ["@service_container"]]
tags:
- { name: twig.extension }