We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 89577a4 + 375e7fd commit 303dc01Copy full SHA for 303dc01
src/Mouf/Mvc/Splash/HtmlResponse.php
@@ -18,6 +18,11 @@ class HtmlResponse extends Response
18
*/
19
protected $htmlElement;
20
21
+ /**
22
+ * @var Stream
23
+ */
24
+ protected $stream;
25
+
26
/**
27
* Constructor.
28
*
@@ -67,12 +72,15 @@ public function getHtmlElement()
67
72
68
73
public function getBody()
69
74
{
70
- ob_start();
71
- $this->htmlElement->toHtml();
- $content = ob_get_clean();
- $stream = new Stream('php://memory', 'wb+');
- $stream->write($content);
75
+ if ($this->stream === null) {
76
+ ob_start();
77
+ $this->htmlElement->toHtml();
78
+ $content = ob_get_clean();
79
+ $this->stream = new Stream('php://memory', 'wb+');
80
+ $this->stream->write($content);
81
82
+ }
83
- return $stream;
84
+ return $this->stream;
85
}
86
0 commit comments