Skip to content

Commit ebfd573

Browse files
author
Marco Bunge
committed
Fix typo
Fix typo
1 parent 47cd5a1 commit ebfd573

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff 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

7975
A 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).

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
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",

src/PresentationServiceProvider.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)