File tree Expand file tree Collapse file tree 3 files changed +9
-20
lines changed Expand file tree Collapse file tree 3 files changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -63,17 +63,13 @@ use \Hawkbit\Presentation\PresentationServiceProvider;
6363
6464$app = new Application(require_once __DIR__ . '/config.php');
6565
66- $entityFactoryClass = \ContainerInteropDoctrine\EntityManagerFactory::class;
6766
68- $PresentationService = new PresentationService([
69- PresentationService::resolveFactoryAlias($entityFactoryClass) => [$entityFactoryClass]
70- ], $app);
71-
72- $app->register(new PresentationServiceProvider($PresentationService));
67+ $app->register(new PresentationServiceProvider([
68+ 'default' => __DIR__ . '/path/to/templates',
69+ 'another' => __DIR__ . '/path/to/other/templates',
70+ ]));
7371```
7472
75- ## Examples
76-
7773### Full configuration
7874
7975A full configuration is available on [ DASPRiD/container-interop-doctrine/example/full-config.php] ( https://github.com/DASPRiD/container-interop-doctrine/blob/master/example/full-config.php ) .
Original file line number Diff line number Diff line change 11{
2- "name" : " hawkbit/Presentation " ,
2+ "name" : " hawkbit/presentation " ,
33 "type" : " hawkbit-component" ,
44 "description" : " Presentation layer for Hawkbit PSR-7 Micro PHP framework" ,
55 "keywords" : [
6- " doctrine " ,
7- " orm " ,
8- " Presentation " ,
6+ " presentation " ,
7+ " view " ,
8+ " template " ,
99 " hawkbit"
1010 ],
1111 "homepage" : " https://github.com/HawkBitPhP" ,
Original file line number Diff line number Diff line change @@ -54,14 +54,7 @@ protected function registerTemplateEngine()
5454 $ container = $ this ->getContainer ();
5555 $ this ->getContainer ()->add (Engine::class, function () use ($ container ) {
5656 $ templates = $ this ->templates ;
57- if (isset ($ templates ['default ' ])) {
58- $ default = $ templates ['default ' ];
59- // unset($templates['default']);
60- } else {
61- $ default = reset ($ templates );
62- // $defaultKey = key($default);
63- // unset($templates[$defaultKey]);
64- }
57+ $ default = isset ($ templates ['default ' ]) ? $ templates ['default ' ] : reset ($ templates );
6558 $ engine = new Engine ($ default );
6659 foreach ($ templates as $ name => $ template ) {
6760 $ engine ->addFolder ($ name , $ template , false );
You can’t perform that action at this time.
0 commit comments