Laravel\Envoy\Compiler::compile PHP Method

compile() public method

Compile the given Envoy template contents.
public compile ( string $value, boolean $serversOnly = false ) : string
$value string
$serversOnly boolean
return string
    public function compile($value, $serversOnly = false)
    {
        $compilers = $serversOnly ? $this->serverCompilers : $this->compilers;
        $value = $this->initializeVariables($value);
        foreach ($compilers as $compiler) {
            $value = $this->{"compile{$compiler}"}($value);
        }
        return $value;
    }

Usage Example

Example #1
0
 /**
  * Write the compiled Envoy file to disk.
  *
  * @param  \Laravel\Envoy\Compiler  $compiler
  * @param  string  $path
  * @return void
  */
 protected function writeCompiledEnvoyFile($compiler, $path, $serversOnly)
 {
     file_put_contents(getcwd() . '/Envoy.php', $compiler->compile(file_get_contents($path), $serversOnly));
 }
All Usage Examples Of Laravel\Envoy\Compiler::compile