compile() public method

Compile the given Envoy template contents.
public compile ( string $value, boolean $serversOnly = false ) : string
$value string
$serversOnly boolean
return string
Beispiel #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));
 }
Beispiel #2
0
 /**
  * Write the compiled Envoy file to disk.
  *
  * @param  \Laravel\Envoy\Compiler  $compiler
  * @param  string  $path
  * @param  bool  $serversOnly
  * @return string
  */
 protected function writeCompiledEnvoyFile($compiler, $path, $serversOnly)
 {
     file_put_contents($envoyPath = getcwd() . '/Envoy' . md5_file($path) . '.php', $compiler->compile(file_get_contents($path), $serversOnly));
     return $envoyPath;
 }