Exemplo n.º 1
0
 /**
  * {default ...}
  */
 public function macroDefault($content)
 {
     if (!$content) {
         throw new InvalidStateException("Missing arguments in {default} on line {$this->filter->line}.");
     }
     return 'extract(' . LatteFilter::formatArray($content) . ', EXTR_SKIP)';
 }
Exemplo n.º 2
0
 private static function fetchNameAndModifiers($code)
 {
     $name = LatteFilter::fetchToken($code);
     $modifiers = LatteFilter::formatArray($code);
     $name = String::startsWith($name, '$') ? $name : "'{$name}'";
     $modifiers = $modifiers ? $modifiers : "array()";
     return array($name, $modifiers);
 }