PHPackages                             tc/twig-default-bundle - 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. tc/twig-default-bundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

tc/twig-default-bundle
======================

TcTwigDefaultBundle

v1.0.0(11y ago)018MITPHPPHP &gt;=5.3.2

Since May 8Pushed 11y ago2 watchersCompare

[ Source](https://github.com/ThreeceeStudios/TcTwigDefaultBundle)[ Packagist](https://packagist.org/packages/tc/twig-default-bundle)[ Docs](https://github.com/ThreeceeStudios/TcTwigDefaultBundle)[ RSS](/packages/tc-twig-default-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Tc Twig Default Bundle
======================

[](#tc-twig-default-bundle)

[![Latest Stable Version](https://camo.githubusercontent.com/278bc348b04a1a869bf0de1e2ba33ea6d432c3629c9ad58d585e6d1bcc499608/68747470733a2f2f706f7365722e707567782e6f72672f74632f747769672d64656661756c742d62756e646c652f762f737461626c65)](https://packagist.org/packages/tc/twig-default-bundle)

Adds a `set_default` tag to twig, which will only set a variable if it doesn't already exist.

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

[](#installation)

```
composer require tc/twig-default-bundle

```

Enable the bundle in your `AppKernel.php`

```
$bundles = array(
    // ...

    new Tc\Bundle\TwigDefault\TcTwigDefaultBundle(),

    // ...
);
```

Usage
-----

[](#usage)

Usage in Twig:

```
{% set_default title = 'One' %}

{# title = One #}

{% set title = 'Two' %}

{# title = Two #}

{% set_default title = 'Three' %}

{# title = Two #}
```

License
-------

[](#license)

TcTwigDefaultBundle is licensed with the MIT license.

See LICENSE for more details.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

4028d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d2d6816fd5e3bcf30fd6cf5cacd03518594c9651ba132248c99ef852dd613426?d=identicon)[carlcraig](/maintainers/carlcraig)

---

Top Contributors

[![carlcraig](https://avatars.githubusercontent.com/u/919781?v=4)](https://github.com/carlcraig "carlcraig (1 commits)")

---

Tags

twigtctwig-default-bundletwig default

### Embed Badge

![Health badge](/badges/tc-twig-default-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tc-twig-default-bundle/health.svg)](https://phpackages.com/packages/tc-twig-default-bundle)
```

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91492.0M315](/packages/twig-extra-bundle)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

555.8M69](/packages/symfony-ux-icons)[yellowskies/qr-code-bundle

Symfony Barcode &amp; QR Code Generator Bundle with Twig extension

36682.9k](/packages/yellowskies-qr-code-bundle)[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)[boekkooi/jquery-validation-bundle

Jquery form validation bundle for symfony 2

2773.9k1](/packages/boekkooi-jquery-validation-bundle)[zenstruck/twig-service-bundle

Make functions, static methods, Symfony service methods available in your twig templates.

1310.1k](/packages/zenstruck-twig-service-bundle)

PHPackages © 2026

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