LightnCandy\Validator::builtin PHP Method

builtin() protected static method

validate builtin helpers
protected static builtin ( array\arraystring | integer> &$context, arrayinteger | string | array> $vars )
$context array\arraystring | integer>
$vars arrayinteger | string | array>
    protected static function builtin(&$context, $vars)
    {
        if ($context['flags']['nohbh']) {
            if (isset($vars[1][0])) {
                $context['error'][] = "Do not support {{#{$vars[0][0]} var}} because you compile with LightnCandy::FLAG_NOHBHELPERS flag";
            }
        } else {
            if (count($vars) < 2) {
                $context['error'][] = "No argument after {{#{$vars[0][0]}}} !";
            }
        }
        $context['usedFeature'][$vars[0][0]]++;
    }