From d1f457a63babcc093e50a9e4e5534f8e798a0b00 Mon Sep 17 00:00:00 2001 From: germdz Date: Tue, 7 Jan 2025 12:09:42 -0300 Subject: [PATCH] Ajustando BaseExtension.php --- .env | 1 + config/services.yaml | 3 ++- src/Twig/BaseExtension.php | 10 ++++------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.env b/.env index f2ce735..261723e 100755 --- a/.env +++ b/.env @@ -35,6 +35,7 @@ SITE_BASE_SCHEME=http SITE_BASE_HOST=localhost SITE_BASE_URL=$SITE_BASE_SCHEME://$SITE_BASE_HOST + ###< redireccion temporal ### SITE_TEMPORAL=true diff --git a/config/services.yaml b/config/services.yaml index 028066b..eca125c 100755 --- a/config/services.yaml +++ b/config/services.yaml @@ -28,6 +28,7 @@ services: autoconfigure: true # Automatically registers your services as commands, event subscribers, etc. bind: + autowire: true $uploadsPath: '%kernel.project_dir%/public/uploads' $pathTemplate: '%kernel.project_dir%/templates' $isDebug: '%kernel.debug%' @@ -37,7 +38,7 @@ services: $site_temporal: '%site_temporal%' $site_podcasts: '%env(resolve:URL_PODCAST)%' $queue_enable: '%queue_enable%' - $publicDir: '%kernel.project_dir%/public' + string $publicDir: '%kernel.project_dir%/public' # makes classes in src/ available to be used as services # this creates a service per class whose id is the fully-qualified class name diff --git a/src/Twig/BaseExtension.php b/src/Twig/BaseExtension.php index f27ce54..dcf26ac 100755 --- a/src/Twig/BaseExtension.php +++ b/src/Twig/BaseExtension.php @@ -16,22 +16,20 @@ class BaseExtension extends AbstractExtension implements ServiceSubscriberInterface { - protected $em; - private $container; + protected EntityManagerInterface $em; + private ContainerInterface $container; private string $publicDir; /** * BaseExtension constructor. * @param EntityManagerInterface $em * @param ContainerInterface $container - * @param string $publicDir */ public function __construct( - EntityManagerInterface $em, ContainerInterface $container, string $publicDir) + EntityManagerInterface $em, ContainerInterface $container) { $this->em = $em; $this->container = $container; - $this->publicDir = $publicDir; } public function getFilters(): array @@ -130,7 +128,7 @@ public function getEncoreEntryCssSource(string $entryName): string $files = $entryPointLookupInterface->getCssFiles($entryName); $source = ''; foreach ($files as $file) { - $source .= file_get_contents($this->publicDir . $file); + $source .= file_get_contents($this->publicDir . '/' . $file); } return $source;