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

Breadcrumb

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

function Finder::name

Adds rules that files must match.

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

$finder->name('/\.php$/') $finder->name('*.php') // same as above, without dot files $finder->name('test.php') $finder->name(['test.py', 'test.php'])

Parameters

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

Return value

$this

See also

FilenameFilterIterator

File

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

Class

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

Namespace

Symfony\Component\Finder

Code

public function name(string|array $patterns) : static {
    $this->names = array_merge($this->names, (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