mirror of
https://github.com/flextype/flextype.git
synced 2025-08-19 11:21:30 +02:00
Flextype Core: FilesystemTwigExtension #165
- new twig function filesystem_get_files_list added.
This commit is contained in:
@@ -24,6 +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_has', [$this, 'has']),
|
||||
new \Twig_SimpleFunction('filesystem_read', [$this, 'read']),
|
||||
new \Twig_SimpleFunction('filesystem_ext', [$this, 'ext']),
|
||||
@@ -31,6 +32,11 @@ class FilesystemTwigExtension extends \Twig_Extension
|
||||
];
|
||||
}
|
||||
|
||||
public function get_files_list(string $folder, $type = null, bool $file_path = true, bool $multilevel = true)
|
||||
{
|
||||
return Filesystem::getFilesList($folder, $type, $file_path, $multilevel);
|
||||
}
|
||||
|
||||
public function has($path)
|
||||
{
|
||||
return Filesystem::has($path);
|
||||
|
Reference in New Issue
Block a user