Skip to content

Commit 477ed35

Browse files
committed
Improve Finder::path code example about resulting matches
1 parent a01f87f commit 477ed35

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/finder.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ Path
202202
Restrict files and directories by path with the
203203
:method:`Symfony\\Component\\Finder\\Finder::path` method::
204204

205-
$finder->path('some/special/dir');
205+
// matches files that contain "data" anywhere in their paths (files or directories)
206+
$finder->path('data');
207+
// for example this will match data/*.xml and data.xml if they exist
208+
$finder->path('data')->name('*.xml');
206209

207210
On all platforms slash (i.e. ``/``) should be used as the directory separator.
208211

0 commit comments

Comments
 (0)