$key
$key :
__construct(string $key, \app\framework\Component\Storage\Storage $storage, boolean $recursive = false, null|string $filter = null)
Constructor
string | $key | File key |
\app\framework\Component\Storage\Storage | $storage | Storage to use |
boolean | $recursive | (Optional) By default, Directory will only read the first level if items. If set to true, Directory will read all children items and list them as one-dimensional array. |
null|string | $filter | (Optional) Filter to use when reading directory items |
getStorage() : \app\framework\Component\Storage\Storage
Get Storage used by the DirectoryInterface instance
Storage instance used for this directory
filter( $condition) : $this
Filter items in a directory using given regex or extension.
Example 1: '.pdf' ($condition starting with means: anything that ends with)
Example 2: 'file' ($condition ending with means: anything that starts with)
Example 3: Any file that ends with file.zip
: '/(\S+)?file.zip/'
$condition |
DirectoryInterface object containing only filtered values
eventManager() : \app\framework\Component\EventManager\EventManager
Get event Manager