public static function install(Latte\Compiler $parser) { $me = new static($parser); $me->addMacro('src', function (MacroNode $node, PhpWriter $writer) use($me) { return $me->macroSrc($node, $writer); }, NULL, function (MacroNode $node, PhpWriter $writer) use($me) { return ' ?> src="<?php ' . $me->macroSrc($node, $writer) . ' ?>"<?php '; }); }
public static function install(Compiler $parser, $baseUrl = null) { self::$baseUrl = $baseUrl; $me = new static($parser); $me->addMacro('src', function (MacroNode $node, PhpWriter $writer) use($me) { return $me->macroSrc($writer); }, null, function (MacroNode $node, PhpWriter $writer) use($me) { return ' ?> src="<?php ' . $me->macroSrc($writer) . ' ?>" data-imager="index"<?php '; }); }