Jade\Compiler::interpolate PHP Метод

interpolate() публичный Метод

public interpolate ( string $text ) : mixed
$text string
Результат mixed
    public function interpolate($text)
    {
        return preg_replace_callback('/(\\\\)?([#!]){(.*?)}/', array($this, 'interpolateFromCapture'), $text);
    }

Usage Example

Пример #1
0
 /**
  * Returns the node string value, line by line.
  * If the compiler is present, that means we need
  * to interpolate line contents
  * @param Filter $node
  * @param Compiler $compiler
  * @return mixed
  */
 protected function getNodeString(Filter $node, Compiler $compiler = null)
 {
     return array_reduce($node->block->nodes, function (&$result, $line) use($compiler) {
         $val = $compiler ? $compiler->interpolate($line->value) : $line->value;
         return $result .= $val . "\n";
     });
 }
All Usage Examples Of Jade\Compiler::interpolate