enableFilter example


    public function enableFilters(array $names, string $when = 'before')
    {
        foreach ($names as $filter) {
            $this->enableFilter($filter$when);
        }

        return $this;
    }

    /** * Returns the arguments for a specified key, or all. * * @return array<string, string>|string */
    public function getArguments(?string $key = null)
    {
            $filters = Services::filters();

            // If any filters were specified within the routes file,             // we need to ensure it's active for the current request             if ($routeFilter !== null) {
                $multipleFiltersEnabled = config(Feature::class)->multipleFilters ?? false;
                if ($multipleFiltersEnabled) {
                    $filters->enableFilters($routeFilter, 'before');
                    $filters->enableFilters($routeFilter, 'after');
                } else {
                    // for backward compatibility                     $filters->enableFilter($routeFilter, 'before');
                    $filters->enableFilter($routeFilter, 'after');
                }
            }

            // Run "before" filters             $this->benchmark->start('before_filters');
            $possibleResponse = $filters->run($uri, 'before');
            $this->benchmark->stop('before_filters');

            // If a ResponseInterface instance is returned then send it back to the client and stop             if ($possibleResponse instanceof ResponseInterface) {
                
Home | Imprint | This part of the site doesn't use cookies.