From 100beec3331e4337c5b78f05c03a417b83214b63 Mon Sep 17 00:00:00 2001 From: Awilum Date: Wed, 3 Jul 2019 13:20:34 +0300 Subject: [PATCH] Flextype Core: FilesystemTwigExtension #165 - new twig function filesystem_get_files_list added. --- flextype/twig/FilesystemTwigExtension.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flextype/twig/FilesystemTwigExtension.php b/flextype/twig/FilesystemTwigExtension.php index 456b4ea6..c83c2931 100644 --- a/flextype/twig/FilesystemTwigExtension.php +++ b/flextype/twig/FilesystemTwigExtension.php @@ -24,7 +24,7 @@ class FilesystemTwigExtension extends \Twig_Extension public function getFunctions() { return [ - new \Twig_SimpleFunction('filesystem_get_files_list', [$this, 'get_files_list']), + new \Twig_SimpleFunction('filesystem_list_contents', [$this, 'list_contents']), new \Twig_SimpleFunction('filesystem_has', [$this, 'has']), new \Twig_SimpleFunction('filesystem_read', [$this, 'read']), new \Twig_SimpleFunction('filesystem_ext', [$this, 'ext']), @@ -32,9 +32,9 @@ class FilesystemTwigExtension extends \Twig_Extension ]; } - public function get_files_list(string $folder, $type = null, bool $file_path = true, bool $multilevel = true) + public function list_contents(string $directory = '', bool $recursive = false) { - return Filesystem::getFilesList($folder, $type, $file_path, $multilevel); + return Filesystem::listContents($directory, $recursive); } public function has($path)