Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Finder.php

function Finder::path

Adds rules that filenames must match.

You can use patterns (delimited with / sign) or simple strings.

$finder->path('some/special/dir') $finder->path('/some\/special\/dir/') // same as above $finder->path(['some dir', 'another/dir'])

Use only / as dirname separator.

Parameters

string|string[] $patterns A pattern (a regexp or a string) or an array of patterns:

Return value

$this

See also

FilenameFilterIterator

File

vendor/symfony/finder/Finder.php, line 261

Class

Finder
Finder allows to build rules to find files and directories.

Namespace

Symfony\Component\Finder

Code

public function path(string|array $patterns) : static {
    $this->paths = array_merge($this->paths, (array) $patterns);
    return $this;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal