craft-plugin craft-glob
Glob plugin for Craft CMS
carlcs/craft-glob
Glob plugin for Craft CMS
- Wednesday, February 3, 2016
- by carlcs
- Repository
- 1 Watchers
- 0 Stars
- 10 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
Glob plugin for Craft CMS
Craft plugin that adds a Twig function to find pathnames in your templates folder matching a pattern., (*1)
The plugin uses the PHP [glob
][1] function internally., (*2)
Installation
To install the plugin, copy the glob/ folder into craft/plugins/. Then go to Settings → Plugins and click the "Install" button next to "Glob"., (*3)
Twig function
glob( path, pattern )
Find pathnames in your templates folder matching a pattern., (*4)
{% set plugins = [
'Asset Metadata',
'Number Convert',
] %}
{% for plugin in plugins %}
{% set dirPath = 'tests/' ~ plugin|camel|lower ~ '/' %}
{% for path in glob(dirPath) %}
<a href="/{{ path }}">{{ path }}</a>
{% endfor %}
{% endfor %}
Parameters
-
path
(optional)
- The sub-path in craft/templates/ you want to search in.
-
pattern
(optional)
- The pattern as described in the PHP [
glob
][1] documentation (Default value is '*.{html,twig}'
).
dev-master
9999999-dev
Glob plugin for Craft CMS
Sources
Download
The Requires