File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,12 @@ directories::
28
28
$finder->files()->in(__DIR__);
29
29
30
30
foreach ($finder as $file) {
31
+ // Print the absolute path
31
32
print $file->getRealpath()."\n";
33
+ // Print the relative path to the file, omitting the filename
34
+ print $file->getRelativePath()."\n";
35
+ // Print the relative path to the file
36
+ print $file->getRelativePathname()."\n";
32
37
}
33
38
34
39
The ``$file `` is an instance of :class: `Symfony\\ Component\\ Finder\\ SplFileInfo `
@@ -208,8 +213,9 @@ To restrict the matching file with your own strategy, use
208
213
$finder->files()->filter($filter);
209
214
210
215
The ``filter() `` method takes a Closure as an argument. For each matching file,
211
- it is called with the file as a :phpclass: `SplFileInfo ` instance. The file is
212
- excluded from the result set if the Closure returns ``false ``.
216
+ it is called with the file as a :class: `Symfony\\ Component\\ Finder\\ SplFileInfo `
217
+ instance. The file is excluded from the result set if the Closure returns
218
+ ``false ``.
213
219
214
220
.. _strtotime : http://www.php.net/manual/en/datetime.formats.php
215
221
.. _Iterator : http://www.php.net/manual/en/spl.iterators.php
You can’t perform that action at this time.
0 commit comments