PHPackages                             shadesoft/twig-glob - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. shadesoft/twig-glob

AbandonedArchivedPackage[Templating &amp; Views](/categories/templating)

shadesoft/twig-glob
===================

Twig extension for usage of PHP's glob function.

v1.1(6y ago)1118MITPHP

Since Oct 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ShadeSoft/TwigGlob)[ Packagist](https://packagist.org/packages/shadesoft/twig-glob)[ Docs](https://github.com/ShadeSoft/TwigGlob)[ RSS](/packages/shadesoft-twig-glob/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

TwigGlob
========

[](#twigglob)

> Twig extension for usage of PHP's glob function.

Installation
------------

[](#installation)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require shadesoft/twig-glob
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

### Including into Symfony 3-4 container (if autowire and autoconfigure is set to true)

[](#including-into-symfony-3-4-container-if-autowire-and-autoconfigure-is-set-to-true)

```
# app/config/services.yml for Symfony 3 or config/services.yaml for Symfony 4

ShadeSoft\Twig\GlobExtension: ~
```

### Including into Symfony 2 container

[](#including-into-symfony-2-container)

```
# app/config/services.yml

shadesoft.twig.glob_extension:
    class: ShadeSoft\Twig\GlobExtension
    tags:
        - { name: twig.extension }
```

### Including into Slim Framework's Twig view renderer

[](#including-into-slim-frameworks-twig-view-renderer)

```
// src/dependencies.php

// ...
$container['view'] = function($c) {
    //...
    $view->addExtension(new ShadeSoft\Twig\GlobExtension);
    //...
}
```

Usage
-----

[](#usage)

Add \\ShadeSoft\\Twig\\GlobExtension to your Twig environment's dependencies (or include into one of the frameworks above), then you can use the filter:

```
{# Without parameters, the filter will return both the matched strings and the found resource as associative array, so you can use it like below: #}
{% for size, icon in 'img/icons/favicon-*.png'|glob %}

{% endfor %}

{# With the optional returnMatch parameter set to false, you will get a simple array with the found resources, like below: #}
{% for css in 'node_modules/@fortawesome/fontawesome-free-webfonts/css/*.css'|glob(false) %}

{% endfor %}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~242 days

Total

3

Last Release

2285d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d07773b12732581240d3515028d3b6a17f8074aa2d3c96250cb97e0243394eb?d=identicon)[sbolch](/maintainers/sbolch)

---

Top Contributors

[![sbolch](https://avatars.githubusercontent.com/u/2583090?v=4)](https://github.com/sbolch "sbolch (7 commits)")

---

Tags

filesystemglobsearchtwigtwig-extensionphpsearchtwigglobdirectoryMatch

### Embed Badge

![Health badge](/badges/shadesoft-twig-glob/health.svg)

```
[![Health](https://phpackages.com/badges/shadesoft-twig-glob/health.svg)](https://phpackages.com/packages/shadesoft-twig-glob)
```

###  Alternatives

[picocms/pico

Pico is a flat file CMS, this means there is no administration backend and database to deal with. You simply create .md files in the "content" folder and that becomes a page.

3.9k37.8k11](/packages/picocms-pico)[squirrelphp/twig-php-syntax

Adds common PHP syntax to twig templates, like ===, foreach and continue/break.

518.7M10](/packages/squirrelphp-twig-php-syntax)[goetas/twital

PHP templating engine that combines Twig and PHPTal power points

12813.0k1](/packages/goetas-twital)[goetas/twital-bundle

Twital templating engine Symfony Bundle

196.8k](/packages/goetas-twital-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
