PHPackages                             diasfs/twig-relative-path - 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. diasfs/twig-relative-path

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

diasfs/twig-relative-path
=========================

Twig extension to work with relative paths

1.0.1(1y ago)017611MITPHPPHP &gt;=7.1.3

Since Jul 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/diasfs/twig-relative-path)[ Packagist](https://packagist.org/packages/diasfs/twig-relative-path)[ RSS](/packages/diasfs-twig-relative-path/feed)WikiDiscussions main Synced yesterday

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

Twig Relative Path Extension
============================

[](#twig-relative-path-extension)

An extension for [Twig](https://twig.symfony.com/) that allows to include and extends templates using relative paths.

Instalation
-----------

[](#instalation)

```
composer require diasfs/twig-relative-path
```

Initialization
--------------

[](#initialization)

```
use Twig\Extension\RelativePathExtension;
use Twig\Environment;

...

$twig = new Environment($loader);
$twig->addExtension(new RelativePathExtension());
```

Example
-------

[](#example)

```
{# layout.html.twig #}

        ...

        {% block content '' %}

{# pages/inc/form.html.twig #}

    ...

{# pages/page.html.twig #}
{% extends "../layout.html.twig" %}

{% block content %}
    {% include './inc/form.html.twig' %}
{% endblock %}
```

The resulting html will be the following:

```
>

        ...

            ...

```

License
-------

[](#license)

The library is released under the MIT License. See the bundled [LICENSE](LICENSE) file for details.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.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 ~430 days

Total

2

Last Release

641d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1634828?v=4)[Fábio Dias](/maintainers/diasfs)[@diasfs](https://github.com/diasfs)

---

Top Contributors

[![diasfs](https://avatars.githubusercontent.com/u/1634828?v=4)](https://github.com/diasfs "diasfs (2 commits)")[![6a5p1](https://avatars.githubusercontent.com/u/26039558?v=4)](https://github.com/6a5p1 "6a5p1 (1 commits)")

---

Tags

twigpathrelativepathsextendsinclude

### Embed Badge

![Health badge](/badges/diasfs-twig-relative-path/health.svg)

```
[![Health](https://phpackages.com/badges/diasfs-twig-relative-path/health.svg)](https://phpackages.com/packages/diasfs-twig-relative-path)
```

###  Alternatives

[symfony/ux-twig-component

Twig components for Symfony

22018.6M356](/packages/symfony-ux-twig-component)[symfony/ux-live-component

Live components for Symfony

1647.0M127](/packages/symfony-ux-live-component)[symfony/ux-toolkit

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

16126.1k1](/packages/symfony-ux-toolkit)[mati365/ckeditor5-symfony

CKEditor 5 integration for Symfony

262.6k](/packages/mati365-ckeditor5-symfony)

PHPackages © 2026

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