PHPackages                             basaltinc/twig-tools - 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. basaltinc/twig-tools

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

basaltinc/twig-tools
====================

v1.4.3(6y ago)1350.4k↓27.1%[1 issues](https://github.com/basaltinc/twig-tools/issues)3MITPHP

Since Nov 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/basaltinc/twig-tools)[ Packagist](https://packagist.org/packages/basaltinc/twig-tools)[ RSS](/packages/basaltinc-twig-tools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (5)Versions (20)Used By (3)

Twig Tools by [Basalt](http://basalt.io)
========================================

[](#twig-tools-by-basalt)

```
composer require basaltinc/twig-tools
```

Twig Functions
--------------

[](#twig-functions)

### `get_data( path )`

[](#get_data-path-)

Takes the path to a `.json`, `.yml`, or `.yaml` file and returns the data for use in Twig.

#### Parameters

[](#parameters)

- `path` {string} Either absolute path, relative path from CWD, or Twig Namespace path like `@namespace/file.json`.

#### Example

[](#example)

```
{% set schema = get_data('@namespace/foobar.schema.yml') %}
```

### `validate_data_schema( path, _self )`

[](#validate_data_schema-path-_self-)

Takes the path to a `.json`, `.yml`, or `.yaml` data schema file and validates the data being used by the twig template file in which the validate function is included. As a standard, this should be the last thing included in a twig template file.

#### Parameters

[](#parameters-1)

- `path` {string} Either absolute path, relative path from CWD, or Twig Namespace path like `@bolt-components-foo/foo.schema.json`.

#### Example

[](#example-1)

```
{{ validate_data_schema('@namesapce/foobar.schema.yml', _self) }}
```

### `console_log( data )`

[](#console_log-data-)

Outputs data to the browser's console log.

#### Parameters

[](#parameters-2)

- `data` Any data you would like to log to the console from a twig template.

#### Example

[](#example-2)

```
{{ console_log(page.meta) }}
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 72.7% 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 ~33 days

Recently: every ~110 days

Total

18

Last Release

2547d ago

Major Versions

v0.1.0 → v1.0.02017-11-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/987cdfed8075c463b2a985c2b4e05b7041b4e97f243f77cc29e4c85a8791a515?d=identicon)[EvanLovely](/maintainers/EvanLovely)

---

Top Contributors

[![EvanLovely](https://avatars.githubusercontent.com/u/569699?v=4)](https://github.com/EvanLovely "EvanLovely (16 commits)")[![jeffam](https://avatars.githubusercontent.com/u/389525?v=4)](https://github.com/jeffam "jeffam (2 commits)")[![joekarasek](https://avatars.githubusercontent.com/u/16548879?v=4)](https://github.com/joekarasek "joekarasek (2 commits)")[![charginghawk](https://avatars.githubusercontent.com/u/7936651?v=4)](https://github.com/charginghawk "charginghawk (1 commits)")[![christophersmith262](https://avatars.githubusercontent.com/u/4907315?v=4)](https://github.com/christophersmith262 "christophersmith262 (1 commits)")

### Embed Badge

![Health badge](/badges/basaltinc-twig-tools/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[symfony/ux-twig-component

Twig components for Symfony

21914.8M162](/packages/symfony-ux-twig-component)[symfony/ux-live-component

Live components for Symfony

1635.6M72](/packages/symfony-ux-live-component)[twig/html-extra

A Twig extension for HTML

787.6M41](/packages/twig-html-extra)[symfony/ux-toolkit

A tool to easily create a design system in your Symfony app with customizable, well-crafted Twig components

1432.0k](/packages/symfony-ux-toolkit)[iq2i/storia-bundle

UI Storia bundle

144.6k](/packages/iq2i-storia-bundle)

PHPackages © 2026

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