From 840147b14c264b9019fc473874931f8c1e090f93 Mon Sep 17 00:00:00 2001 From: Angie LAURENTI Date: Wed, 17 Jul 2019 18:57:44 +0200 Subject: [PATCH] Fix usage CLI in toHtml --- src/Mouf/Html/Template/BootstrapTemplate.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Mouf/Html/Template/BootstrapTemplate.php b/src/Mouf/Html/Template/BootstrapTemplate.php index 7336c8c..240e615 100644 --- a/src/Mouf/Html/Template/BootstrapTemplate.php +++ b/src/Mouf/Html/Template/BootstrapTemplate.php @@ -135,7 +135,9 @@ public function toHtml() // Let's register the template renderer in the default renderer. $this->getDefaultRenderer()->setTemplateRenderer($this->getTemplateRenderer()); - header('Content-Type: text/html; charset=utf-8'); + if (PHP_SAPI !== 'cli') { + header('Content-Type: text/html; charset=utf-8'); + } //Renderable::toHtml();// __DIR__."/../../../../views/template.php"; $this->toHtmlRenderer(); }