public function injectAssets(Response $response) { $inject = $this->getAssetCode(); $html = $response->getContent(); if (stripos($html, '</head>') !== false) { $html = str_replace('</head>', $inject['css'] . PHP_EOL . '</head>', $html); } if (stripos($html, '</body>') !== false) { $html = str_replace('</body>', $inject['js'] . PHP_EOL . '</body>', $html); } $response->setContent($html); }
public function raw($data) { $this->response->disableLayout(); $this->response->setContent($data); return $this->response; }