Essence\Utility\Template::_compileFunction PHP 메소드

_compileFunction() 보호된 정적인 메소드

Returns a function used to replace variables by values.
또한 보기: compile()
protected static _compileFunction ( array $variables, callable | null $filter ) : Closure
$variables array Variables.
$filter callable | null Filter function.
리턴 Closure Function.
    protected static function _compileFunction(array $variables, $filter)
    {
        return function ($matches) use($variables, $filter) {
            $name = $matches['variable'];
            $value = isset($variables[$name]) ? $variables[$name] : '';
            return $filter ? call_user_func($filter, $value) : $value;
        };
    }