Exemple #1
0
 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);
 }
Exemple #2
0
 public function raw($data)
 {
     $this->response->disableLayout();
     $this->response->setContent($data);
     return $this->response;
 }