Skip to content

Commit 767c8e2

Browse files
committed
Only set PHPRenderer if its an Mezzio app
1 parent ef234bc commit 767c8e2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

config/module.config.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Fabiang\AsseticBundle;
44

55
use Laminas\Mvc\Application as MvcApplication;
6+
use Mezzio\Application as MezzioApplication;
67
use Laminas\View\Renderer;
78
use Laminas\ServiceManager\Factory\InvokableFactory;
89

@@ -23,8 +24,6 @@
2324
'Fabiang\AsseticBundle\Cli' => Cli\ApplicationFactory::class,
2425
Configuration::class => Factory\ConfigurationFactory::class,
2526
AsseticMiddleware::class => Factory\AsseticMiddlewareFactory::class,
26-
// needed for Mezzio
27-
Renderer\PhpRenderer::class => InvokableFactory::class,
2827
],
2928
],
3029
'assetic_configuration' => [
@@ -44,5 +43,10 @@
4443
];
4544
}
4645

46+
if (class_exists(MezzioApplication::class)) {
47+
// needed for Mezzio
48+
$config['service_manager']['factories'][Renderer\PhpRenderer::class] = InvokableFactory::class;
49+
}
50+
4751
return $config;
4852
})();

0 commit comments

Comments
 (0)