Set the supported extensions for this route.

@param array $extensions The extensions to set.
@return $this
1057
public function setExtensions(array $extensions)
    {
        $this->_extensions = [];
        foreach ($extensions as $ext) {
            $this->_extensions[] = strtolower($ext);
        }

        return $this;
    }
1219235
public function setDomains($domains)
    {
        if (is_array($domains)) {
            foreach ($domains as $domain) {
                $this->setDomains($domain);
            }
            return $this;
        }

        $this->domains[] = $domains;

        return $this;
    }
694372
public function resetFilters($extension = null)
    {
        if ($extension === null) {
            $this->filters = [];
        }
        else {
            $this->filters[$extension] = [];
        }

        return $this;
    }
650294
public function setExtension($extension)
    {
        if (is_string($extension) && preg_match(Number::GUID_REGEX, $extension)) {
            return $this->extension_guid = $extension;
        }
        if ($extension instanceof Extension) {
            return $this->extension_guid = $extension->guid;
        }
        return false;
    }
125078
public function addExtensions($extensions): self
    {
        $this->fileExtensions = \array_unique(\array_merge($this->fileExtensions, \array_map('strtolower', (array) $extensions)));
        
        return $this;
    }
842957
@Nonnull
  public PreprocessorContext setExtensions(@Nonnull @MustNotContainNull final List<String> extensions) {
    this.extensions = new HashSet<>(assertDoesntContainNull(extensions));
    return this;
  }
946342
public function addExtension(AbstractExtension $extension)
    {
        if (!$extension->isAvailable()) {
            throw new ExtensionException('Extension ' . get_class($extension) . ' is not available', $extension);
        }

        $this->extensions[] = $extension->bind($this);
    }
762689
public function setDependencyPhpExtensions($extensions)
    {
        foreach($extensions as $_extension) {
            $this->addDependencyExtension(
                $_extension['name'],
                $_extension['min_version'],
                $_extension['max_version']
            );
        }
        return $this;
    }
43059
public function setFields(array $fields)
    {
        $this->checkValidLoader();

        // Flatten
        $this->loaders[ $this->contextLoader ] = [];
        $this->addFields($fields);

        return $this;
    }
679295
public function addExtension(ExtensionInterface $extension)
    {
        if (!in_array($extension, $this->extensions)) {
            $this->extensions[] = $extension;
            $options = Phug::getExtensionsOptions([$extension]);
            foreach ([$this, $this->getCompiler()] as $instance) {
                $instance->setOptionsRecursive($options);
            }

            $this->initCompiler();
        }
    }
458372
public function setViewsExtension(string $extension)
  {
    if (substr($extension, 0, 1) != '.') {
      $this->viewsExtension = '.' . $extension;
      return $this;
    }

    $this->viewsExtension = $extension;
    return $this;
  }
641234
public function set(array $files)
    {
        if (!empty($files)) {
            foreach ($files as $_file) {
                $this->add($_file);
            }
        }
        return $this;
    }
1330225
public function extension($extension)
    {
        if (is_string($extension)) {
            $this->extension = ltrim($extension, '.');
        } else {
            $this->extension = null;
        }

        return $this;
    }
505609
public function setFormats($formats)
    {
        if (is_array($formats)) {
            $formats = json_encode($formats);
        }

        $this->formats = $formats;

        return $this;
    }
70830
public function setExtends(string $extends, string $alias = null)
    {
        $this->extends = $this->addUse($extends, $alias);

        return $this;
    }
983170
public function allowMethods(array $methods = []): Route
    {
        $this->methods = [];
        foreach ($methods as $method) {
            $this->allowMethod($method);
        }

        return $this;
    }
897387
public function setOptions(array $options = array())
    {
        if (array_key_exists('messages', $options)) {
            $this->setMessages($options['messages']);
        }

        if (array_key_exists('hostname', $options)) {
            if (array_key_exists('allow', $options)) {
                $this->setHostnameValidator($options['hostname'], $options['allow']);
            } else {
                $this->setHostnameValidator($options['hostname']);
            }
        } elseif ($this->_options['hostname'] == null) {
            $this->setHostnameValidator();
        }

        if (array_key_exists('mx', $options)) {
            $this->setValidateMx($options['mx']);
        }

        if (array_key_exists('deep', $options)) {
            $this->setDeepMxCheck($options['deep']);
        }

        if (array_key_exists('domain', $options)) {
            $this->setDomainCheck($options['domain']);
        }

        return $this;
    }