Skip to content

Commit

Permalink
minor #6652 Finder::path() method matching directories and files (s…
Browse files Browse the repository at this point in the history
…oyuka)

This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #6652).

Discussion
----------

`Finder::path()` method matching directories and files

For clarity, adds an example where `path()` is used to match a directory or a file.

ref api-platform/core#575 (comment)

Commits
-------

cd28675 Improve `Finder::path` code example about resulting matches
  • Loading branch information
xabbuh committed Jun 20, 2016
2 parents 1026863 + cd28675 commit fe24815
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/finder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ Path
Restrict files and directories by path with the
:method:`Symfony\\Component\\Finder\\Finder::path` method::

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

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

Expand Down

0 comments on commit fe24815

Please sign in to comment.