fix: register Twig template namespace for plugin views
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1b88878210
commit
5c26d205f7
1 changed files with 11 additions and 1 deletions
|
|
@ -4,14 +4,24 @@ namespace KimaiPlugin\KimaiHeatmapBundle\DependencyInjection;
|
||||||
|
|
||||||
use Symfony\Component\Config\FileLocator;
|
use Symfony\Component\Config\FileLocator;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
|
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
||||||
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
|
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
|
||||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||||
|
|
||||||
class KimaiHeatmapExtension extends Extension
|
class KimaiHeatmapExtension extends Extension implements PrependExtensionInterface
|
||||||
{
|
{
|
||||||
public function load(array $configs, ContainerBuilder $container): void
|
public function load(array $configs, ContainerBuilder $container): void
|
||||||
{
|
{
|
||||||
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
|
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
|
||||||
$loader->load('services.yaml');
|
$loader->load('services.yaml');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function prepend(ContainerBuilder $container): void
|
||||||
|
{
|
||||||
|
$container->prependExtensionConfig('twig', [
|
||||||
|
'paths' => [
|
||||||
|
__DIR__ . '/../Resources/views' => 'KimaiHeatmapBundle',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue