src/PugHandlerTrait.php
public function compileWith($path, callable $callback = null)
    {
        $path = $this->extractPath($path);

        if ($this->cachePath) {
            $pug = $this->getCompiler();
            $compiled = $this->getCompiledPath($path);
            $contents = $pug->compile($this->files->get($path), $path);

            if ($callback) {
                $contents = call_user_func($callback, $contents);
            }

            if ($pug instanceof \Phug\Compiler) {
                $this->files->put(
                    $compiled . '.imports.serialize.txt',
                    serialize($pug->getCurrentImportPaths())
                );
            }

            $this->files->put($compiled, $contents);
        }
    }
public function compileWith($path, callable $callback = null)
    {
        $path = $this->extractPath($path);

        if ($this->cachePath) {
            $pug = $this->getCompiler();
            $compiled = $this->getCompiledPath($path);
            $contents = $pug->compile($this->files->get($path), $path);

            if ($callback) {
                $contents = call_user_func($callback, $contents);
            }

            if ($pug instanceof \Phug\Compiler) {
                $this->files->put(
                    $compiled . '.imports.serialize.txt',
                    serialize($pug->getCurrentImportPaths())
                );
            }

            $this->files->put($compiled, $contents);
        }
    }
Compile the view at the given path.

@param string        $path
@param callable|null $callback

@throws \InvalidArgumentException

@return void