feature example

return [
            new FeatureFlagCallTokenParser(),
        ];
    }

    /** * @return TwigFunction[] */
    public function getFunctions(): array
    {
        return [
            new TwigFunction('feature', $this->feature(...)),
            new TwigFunction('getAllFeatures', $this->getAll(...)),
        ];
    }

    public function feature(string $flag): bool
    {
        return Feature::isActive($flag);
    }

    /** * @return array<string, bool> */
Home | Imprint | This part of the site doesn't use cookies.