PHPackages                             herrera-io/silex-active-link - 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. herrera-io/silex-active-link

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

herrera-io/silex-active-link
============================

A Silex service provider for finding an active link in Twig.

1.0.0(12y ago)0478↑2042.9%MITPHPPHP &gt;=5.3.3

Since Aug 13Pushed 12y agoCompare

[ Source](https://github.com/kherge-archive/php-silex-active-link)[ Packagist](https://packagist.org/packages/herrera-io/silex-active-link)[ Docs](http://github.com/herrera-io/php-silex-active-link)[ RSS](/packages/herrera-io-silex-active-link/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (2)Used By (0)

Active Link
===========

[](#active-link)

[![Build Status](https://camo.githubusercontent.com/733a0090cbdfe7b29924dd5eb9fcdee66f0b4421fb7ec96f69cf20bc2f5d6a59/68747470733a2f2f7472617669732d63692e6f72672f686572726572612d696f2f7068702d73696c65782d6163746976652d6c696e6b2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/herrera-io/php-silex-active-link)

A very simple Silex service provider for checking active links in Twig.

Example
-------

[](#example)

In PHP:

```
use Herrera\Silex\ActiveLinkServiceProvider;
use Silex\Application;
use Silex\Provider\TwigServiceProvider;
use Symfony\Component\HttpFoundation\Request;

$app = new Application();

$app->get(
    '/',
    function (Application $app) {
        return $app['twig']->render('test.html.twig');
    }
)->bind('home');

$app->get(
    '/page',
    function (Application $app) {
        return $app['twig']->render('test.html.twig');
    }
)->bind('page');

$app->register(
    new TwigServiceProvider(),
    array(
        'twig.path' => '/path/to/templates'
    )
);

$app->register(
    new ActiveLinkServiceProvider()
);

$app->run(
    Request::create('/page')
);
```

The Twig template:

```

  Home
  Page

```

The result when request `page`:

```

  Home
  Page

```

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

[](#installation)

Use Composer:

```
$ composer require "herrera-io/silex-active-link=~1.0"

```

Configuration
-------------

[](#configuration)

There is only one configuration parameter: `active_link.snippet`

The `active_link.snippet` is the result returned if a link is active. By default, the result is ` class="active"` (note that the space is included). Hopefully, this provides you with a far greater degree of flexibility in how you can use the new `active` Twig function.

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community6

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

4605d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9122157?v=4)[Kevin Herrera](/maintainers/kherge)[@kherge](https://github.com/kherge)

---

Top Contributors

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

---

Tags

twigsilex

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/herrera-io-silex-active-link/health.svg)

```
[![Health](https://phpackages.com/badges/herrera-io-silex-active-link/health.svg)](https://phpackages.com/packages/herrera-io-silex-active-link)
```

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91389.2M261](/packages/twig-extra-bundle)[twig/intl-extra

A Twig extension for Intl

36661.2M174](/packages/twig-intl-extra)[twig/string-extra

A Twig extension for Symfony String

21944.4M102](/packages/twig-string-extra)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

22918.0M42](/packages/twig-cssinliner-extra)[symfony/ux-twig-component

Twig components for Symfony

21813.7M112](/packages/symfony-ux-twig-component)[twig/markdown-extra

A Twig extension for Markdown

12113.8M70](/packages/twig-markdown-extra)

PHPackages © 2026

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