summaryrefslogtreecommitdiff
path: root/src/Renderer
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-09-19 23:55:24 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2017-09-19 23:55:24 +0200
commit1e267ce3b133299f82661a37d82c0f50e8575e1e (patch)
treeb91dc4f15f3fa69fbb101b0579b539f71c9a0d51 /src/Renderer
parent2cb636b651c889243919d99eda8fa724d5c08392 (diff)
Added Renderer unit test
Diffstat (limited to 'src/Renderer')
-rw-r--r--src/Renderer/HtmlEngine.php2
-rw-r--r--src/Renderer/Renderer.php9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/Renderer/HtmlEngine.php b/src/Renderer/HtmlEngine.php
index 4a48e1f0..75343bbd 100644
--- a/src/Renderer/HtmlEngine.php
+++ b/src/Renderer/HtmlEngine.php
@@ -29,6 +29,6 @@ class HtmlEngine implements EngineInterface
*/
public function canRender($path)
{
- return strpos($path, '.html') && file_exists($path);
+ return strpos($path, '.htm') && file_exists($path);
}
}
diff --git a/src/Renderer/Renderer.php b/src/Renderer/Renderer.php
index 5ed7cf31..de31ca74 100644
--- a/src/Renderer/Renderer.php
+++ b/src/Renderer/Renderer.php
@@ -2,8 +2,12 @@
namespace Engelsystem\Renderer;
+use Psr\Log\LoggerAwareTrait;
+
class Renderer
{
+ use LoggerAwareTrait;
+
/** @var EngineInterface[] */
protected $renderer = [];
@@ -24,7 +28,10 @@ class Renderer
return $renderer->get($template, $data);
}
- engelsystem_error('Unable to find a renderer for template file "' . $template . '".');
+ if ($this->logger) {
+ $this->logger->error('Unable to find a renderer for template file "{file}"', ['file' => $template]);
+ }
+
return '';
}