Stolz / Assets

An ultra-simple-to-use assets management library for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Load all assets from a directory

almamund opened this issue · comments

Hello,

Is there a way to load all css, js files from a directory/subdirectory?

Regards
Almamun

You could always use a directory iterator / glob to build the array yourself. Not a terrible idea to include it in the package, I'd think... Or perhaps some wildcards are in order? I think the only issue with this, however, is determining the correct order in which assets should be loaded. So, if a feature like this is implemented, it would need to give fair warning in terms of that.

commented

You can use the "addDir" function to add all assets matching a pattern within a directory.

https://github.com/Stolz/Assets/blob/master/API.md#adddir

Ah, didn't see that. 👍