/** * Publish a source file and/or pass to $next. * * @param Source $source * @param Closure $next * @param array $extensions * @return mixed */ public function handle(Source $source, Closure $next, ...$extensions) { if ($this->isPublishable($source, $extensions)) { $view = new View($this->factory, $this->factory->getEngineFromPath($source->getPathname()), $this->files->get($source->getPathname()), $source->getPathname()); $source->changeExtension(['.blade.php' => '.html'])->changeExtension(['.php' => '.html']); $this->write($source->getOutputPathname(), $view->render()); } $next($source); }
/** * Get the evaluated contents of the view. * * @param string $path * @param array $data * @return string */ public function get($path, array $data = []) { // To preserve the capability of using any underlying templating system, // e.g. the Blade template or any templating engines that has already // been integrated to Illuminate View, Premailer will act as wrapper, // that will only inlined the CSS from the template system result. $result = $this->engine->get($path, $data); $premailer = new HtmlString($result); return $premailer->getHtml(); }
/** * Get the evaluated contents of the view. * * @return string */ protected function getContents() { return $this->engine->get($this->path, $this->gatherData()); }
/** * Get the evaluated contents of the LESS. * * @return string */ protected function getContents() { return $this->engine->get($this->path); }