src/Utility/Template.php
public static function getTokens($template, $pre = '%%', $post = '%%')
    {
        $tokens = [];
        $regex = "/$pre(.*?)$post/";
        if (preg_match_all($regex, $template, $matches)) {
            $tokens = array_unique($matches[1]);
        }

        natsort($tokens);

        return $tokens;
    }
public static function getTokens($template, $pre = '%%', $post = '%%')
    {
        $tokens = [];
        $regex = "/$pre(.*?)$post/";
        if (preg_match_all($regex, $template, $matches)) {
            $tokens = array_unique($matches[1]);
        }

        natsort($tokens);

        return $tokens;
    }
public static function getTokens ( $ template , $ pre = '%%' , $ post = '%%' ) { $ tokens = [ ] ; $ regex = "/$pre(.*?)$post/" ; if ( preg_match_all ( $ regex , $ template , $ matches ) ) { $ tokens = array_unique ( $ matches [ 1 ] ) ; } natsort ( $ tokens ) ; return $ tokens ; }
Returns a list of unique tokens found in a given template

@param string $template Template content
@param string $pre Token prefix
@param string $post Token postfix

@return array List of tokens
Returns a list of unique tokens found in a given template