PHPackages                             kilroyweb/klink - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kilroyweb/klink

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kilroyweb/klink
===============

Package for easily setting classes for active links

1.0.3(9y ago)2112MITPHP

Since Oct 28Pushed 9y ago1 watchersCompare

[ Source](https://github.com/kilroyweb/Klink)[ Packagist](https://packagist.org/packages/kilroyweb/klink)[ RSS](/packages/kilroyweb-klink/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)DependenciesVersions (5)Used By (0)

\#Klink

A simple way to manage active menu items

Install
-------

[](#install)

```
composer require kilroyweb/klink
```

In config/app.php 'providers':

```
KilroyWeb\Klink\KlinkServiceProvider::class,
```

In config/app.php 'facades':

```
'Klink'=> KilroyWeb\Klink\Facades\Klink::class,
```

Usage
-----

[](#usage)

Klink must start with the "url" method, from there options can be added as needed

### Create menu items

[](#create-menu-items)

```

    {!! Klink::url('my-account')->label('My Account') !!}
    {!! Klink::url('logout')->label('Logout') !!}

```

Results (If on /my-account page)

```

    My Account
    Logout

```

### Remove change or remove "li" container element

[](#remove-change-or-remove-li-container-element)

```
{!! Klink::url('my-account')->label('My Account')->container(false) !!}
{!! Klink::url('my-account')->label('My Account')->container('h3') !!}
```

Results

```
My Account
My Account
```

Or when on the "my-account" page:

```
My Account
My Account
```

### Check Multiple URLs

[](#check-multiple-urls)

```
{!! Klink::url('my-account')->alsoCheck(['/profile', '/'])->label('My Account') !!}
```

Results (when on the /profile, /, or /my-account pages)

```
My Account
```

### Output only the active class

[](#output-only-the-active-class)

Sometimes you have a custom link where you just need to set the class as active:

```

        My Account

```

Will return `class="active"` on the my-account page, otherwise will return empty `class=""`

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~32 days

Total

4

Last Release

3436d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20406973?v=4)[kilroyweb](/maintainers/kilroyweb)[@kilroyweb](https://github.com/kilroyweb)

---

Top Contributors

[![kilroyweb](https://avatars.githubusercontent.com/u/20406973?v=4)](https://github.com/kilroyweb "kilroyweb (3 commits)")[![kilrizzy](https://avatars.githubusercontent.com/u/132478?v=4)](https://github.com/kilrizzy "kilrizzy (1 commits)")

---

Tags

linkhtmlactive

### Embed Badge

![Health badge](/badges/kilroyweb-klink/health.svg)

```
[![Health](https://phpackages.com/badges/kilroyweb-klink/health.svg)](https://phpackages.com/packages/kilroyweb-klink)
```

###  Alternatives

[caxy/php-htmldiff

A library for comparing two HTML files/snippets and highlighting the differences using simple HTML.

21522.3M21](/packages/caxy-php-htmldiff)

PHPackages © 2026

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