summaryrefslogtreecommitdiff
path: root/src/Renderer/RendererServiceProvider.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-11-28 15:43:51 +0100
committerGitHub <noreply@github.com>2017-11-28 15:43:51 +0100
commit599f2fd264bfc7b1b6826fe206442806e317340f (patch)
tree50cf84d7d07d11bd65b45c2c17f37632f6cd8eff /src/Renderer/RendererServiceProvider.php
parenta5fc5bd0979e8de1fce8a8addd351a6e7bd6aeb8 (diff)
parenteda7f7788ea8012bd8be46405c56a666c11f3fa5 (diff)
Merge pull request #365 from engelsystem/feature-igel-rewrite
Feature igel rewrite
Diffstat (limited to 'src/Renderer/RendererServiceProvider.php')
-rw-r--r--src/Renderer/RendererServiceProvider.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/Renderer/RendererServiceProvider.php b/src/Renderer/RendererServiceProvider.php
new file mode 100644
index 00000000..3e8d69bc
--- /dev/null
+++ b/src/Renderer/RendererServiceProvider.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace Engelsystem\Renderer;
+
+use Engelsystem\Container\ServiceProvider;
+
+class RendererServiceProvider extends ServiceProvider
+{
+ public function register()
+ {
+ $this->registerRenderer();
+ $this->registerHtmlEngine();
+ }
+
+ public function boot()
+ {
+ $renderer = $this->app->get('renderer');
+
+ foreach ($this->app->tagged('renderer.engine') as $engine) {
+ $renderer->addRenderer($engine);
+ }
+ }
+
+ protected function registerRenderer()
+ {
+ $renderer = $this->app->make(Renderer::class);
+ $this->app->instance('renderer', $renderer);
+ }
+
+ protected function registerHtmlEngine()
+ {
+ $htmlEngine = $this->app->make(HtmlEngine::class);
+ $this->app->instance('renderer.htmlEngine', $htmlEngine);
+ $this->app->tag('renderer.htmlEngine', ['renderer.engine']);
+ }
+}