Example #1
0
 public static function get_tags()
 {
     $tags = ['variable' => ['regex' => '\\{\\$(?P<variable>[\\w\\.]+)+(?:\\s+(?P<filters>.+?))?\\}(?:(?P<inside>.*?)\\{/\\$\\1+\\})?', 'fn' => function ($matches) {
         return Template::do_variable($matches);
     }], 'if' => ['regex' => '(?P<initial>\\{\\?\\s*(?P<condition>.+?)\\s*\\})\\s*(?P<inside_if>.+?)\\s*\\{/\\?\\}', 'fn' => function ($matches) {
         return Template::do_if($matches);
     }]];
     return $tags;
 }