-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule.php
More file actions
29 lines (23 loc) · 1.01 KB
/
Copy pathmodule.php
File metadata and controls
29 lines (23 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
declare(strict_types=1);
use Marko\Core\Container\ContainerInterface;
use Marko\View\Blade\BladeCompilerFactory;
use Marko\View\Blade\BladeView;
use Marko\View\ViewInterface;
return [
'bindings' => [
BladeCompilerFactory::class => function (ContainerInterface $container): BladeCompilerFactory {
$viewConfig = $container->get(\Marko\View\ViewConfig::class);
$resolver = $container->get(\Marko\View\TemplateResolverInterface::class);
$basePath = null;
if ($container->has(\Marko\Core\Path\ProjectPaths::class)) {
$basePath = $container->get(\Marko\Core\Path\ProjectPaths::class)->base;
}
return new BladeCompilerFactory($viewConfig, $resolver, null, $basePath, $container);
},
ViewInterface::class => function (ContainerInterface $container): ViewInterface {
$factory = $container->get(BladeCompilerFactory::class)->create();
return new BladeView($factory);
},
],
];