public function appendContent($content) { $existingContent = $this->getContent(); if (false === mb_strpos($existingContent, "</body>", null, $this->getCharset())) { return parent::appendContent($content); } return $this->setContent(str_replace("</body>", "{$content}</body>", $existingContent)); }