File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,34 @@ The ``notContains()`` method excludes files containing given pattern::
175
175
176
176
$finder->files()->notContains('dolor sit amet');
177
177
178
+ Path
179
+ ~~~~
180
+
181
+ .. versionadded :: 2.2
182
+ Methods ``path() `` and ``notPath() `` have been
183
+ introduced in version 2.2.
184
+
185
+ Restrict files and directories by path with the
186
+ :method: `Symfony\\ Component\\ Finder\\ Finder::path ` method::
187
+
188
+ $finder->path('some/special/dir');
189
+
190
+ On all platforms slash (i.e. ``/ ``) should be used as a separator.
191
+
192
+ The ``path() `` method accepts strings or regexes::
193
+
194
+ $finder->path('foo/bar');
195
+ $finder->path('/^foo\/bar/');
196
+
197
+ Strings are converted into regexes by escaping slashes and adding delimiters:
198
+
199
+ dirname ===> /dirname/
200
+ a/b/c ===> /a\/ b\/ c/
201
+
202
+ The ``notPath() `` method excludes files by path::
203
+
204
+ $finder->notPath('other/dir');
205
+
178
206
File Size
179
207
~~~~~~~~~
180
208
You can’t perform that action at this time.
0 commit comments