, dreipunktnull * @package Vhs * @subpackage ViewHelpers\Media */ class FilesViewHelper extends AbstractViewHelper { /** * Initialize arguments. * * @return void * @api */ public function initializeArguments() { $this->registerArgument('path', 'string', 'Path to the folder containing the files to be listed.', TRUE); $this->registerArgument('extensionList', 'string', 'A comma seperated list of file extensions to pick up.', FALSE, ''); $this->registerArgument('prependPath', 'boolean', 'If set to TRUE the path will be prepended to file names.', FALSE, FALSE); $this->registerArgument('order', 'string', 'If set to "mtime" sorts files by modification time or alphabetically otherwise.', FALSE, ''); $this->registerArgument('excludePattern', 'string', 'A comma seperated list of filenames to exclude, no wildcards.', FALSE, ''); } /** * @return array */ public function render() { $path = $this->arguments['path']; if (NULL === $path) { $path = $this->renderChildren(); if (NULL === $path) { return array(); } } $extensionList = $this->arguments['extensionList']; $prependPath = $this->arguments['prependPath']; $order = $this->arguments['order']; $excludePattern = $this->arguments['excludePattern']; $files = GeneralUtility::getFilesInDir($path, $extensionList, $prependPath, $order, $excludePattern); return $files; } }