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