LightnCandy\Validator::section PHP Method

section() protected static method

validate section token
protected static section ( array\arraystring | integer> &$context, arrayinteger | string | array> $vars, boolean $isEach = false ) : boolean
$context array\arraystring | integer>
$vars arrayinteger | string | array>
$isEach boolean the section is #each
return boolean Return true always
    protected static function section(&$context, $vars, $isEach = false)
    {
        if ($isEach) {
            static::builtin($context, $vars);
        } else {
            if (count($vars) > 1 && !$context['flags']['lambda']) {
                $context['error'][] = "Custom helper not found: {$vars[0][0]} in " . Token::toString($context['currentToken']) . ' !';
            }
            $context['usedFeature']['sec']++;
        }
        return true;
    }