a8da7a1efe57e25458ee73572648b3e460aa62d2
[bdrem.git] / src / bdrem / Renderer.php
1 <?php
2 namespace bdrem;
3
4 abstract class Renderer
5 {
6     protected $httpContentType = null;
7
8     public function renderAndOutput($arEvents)
9     {
10         if (PHP_SAPI != 'cli' && $this->httpContentType !== null) {
11             header('Content-type: ' . $this->httpContentType);
12         }
13         echo $this->render($arEvents);
14     }
15
16     abstract public function render($arEvents);
17 }
18 ?>