-
Notifications
You must be signed in to change notification settings - Fork 9
Filesystem Collection
The filesystem collection allows you to easily retrieve data from any path in the filesystem. The files should contain structured data. The supported data types are YAML, JSON, INI, PHP, XML and MD (markdown)
A filesystem collection can be defined easily by specifying the path where the collection should be retrieved from, for example:
collection:
model: filesystem?path=data://team/members
Note: filesystem
is a shortcut for the com:pages.model.filesystem
identifier
The path
parameter defines the location for the filesystem collection and can be templated using the template URIs standard. When a template URI is used, the model state will be used to expand the template URL, for example:
collection:
model: filesystem?path=data://{+path}{/segments*}
state:
path: /foo/bar
segments: ['one', 'two']
The resulting model would be filesystem?path=data://foo/bar/one/`.
If the path
starts with data://
it will be loaded through the data registry. If not the file will be loaded directly.
See also: Data
To create custom filesystem collections you need to extend the ComPagesModelFilesystem
class.
[todo]
Got a question or need help? We have a forum on Github Discussions where you can get in touch with us.