PHPackages                             shadesoft/twig-video-box - 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-video-box

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

shadesoft/twig-video-box
========================

Twig extensions for making video embedding easy.

v1.1(6y ago)150MITPHP

Since Sep 18Pushed 4y agoCompare

[ Source](https://github.com/ShadeSoft/TwigVideoBox)[ Packagist](https://packagist.org/packages/shadesoft/twig-video-box)[ Docs](https://github.com/ShadeSoft/TwigVideoBox)[ RSS](/packages/shadesoft-twig-video-box/feed)WikiDiscussions master Synced today

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

TwigVideoBox
============

[](#twigvideobox)

> Twig extensions for making video embedding easy.

Currently supports YouTube. Other video sharing sites will be available later.

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-video-box
```

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\YouTubeExtension: ~
```

### Including into Symfony 2 container

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

```
# app/config/services.yml

shadesoft.twig.video_box.youtube_extension:
    class: ShadeSoft\Twig\YouTubeExtension
    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\YouTubeExtension);
    //...
}
```

Usage
-----

[](#usage)

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

```
{{ 'youtube_video_id'|youtube }} {# Renders YouTube with the default dimensions (560x315) #}
{{ 'youtube_video_id'|youtube(640) }} {# Renders YouTube with the width given (640x315) #}
{{ 'youtube_video_id'|youtube(640, 480) }} {# Renders YouTube with both dimensions given (640x480) #}
{{ 'youtube_video_id'|youtube('100%') }} {# Renders YouTube with the width fluid (100% x 315px) #}

{% set content = 'Youtube video:http://youtu.be/video_id' %}
{{ content|youtubeBoxes|raw }} {# Renders the div with the p and the embedded video inside content #}
{# With this you can render multiple video boxes in a html content, you can simply use any valid YouTube url to the video #}
{# The width and height parameters can be used here, too #}
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

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 ~252 days

Total

3

Last Release

2337d 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 (15 commits)")

---

Tags

twigtwig-extensionvideoyoutubetwigvideoembed

### Embed Badge

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

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

###  Alternatives

[timber/timber

Create WordPress themes with beautiful OOP code and the Twig Template Engine

5.7k3.6M127](/packages/timber-timber)[twig/intl-extra

A Twig extension for Intl

36567.2M320](/packages/twig-intl-extra)[symfony/ux-twig-component

Twig components for Symfony

22017.2M313](/packages/symfony-ux-twig-component)[symfony/ux-live-component

Live components for Symfony

1636.5M115](/packages/symfony-ux-live-component)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

22919.7M81](/packages/twig-cssinliner-extra)[twig/inky-extra

A Twig extension for the inky email templating engine

16613.2M70](/packages/twig-inky-extra)

PHPackages © 2026

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