PHPackages                             erosdelalamo/yii2-url-shortener - 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. erosdelalamo/yii2-url-shortener

ActiveYii2-extension

erosdelalamo/yii2-url-shortener
===============================

An extension to work with own shortened urls

1.0.0(3y ago)24.4k↓20.8%3[1 PRs](https://github.com/Eseperio/yii2-url-shortener/pulls)GPL-3.0-or-laterPHP

Since Jul 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Eseperio/yii2-url-shortener)[ Packagist](https://packagist.org/packages/erosdelalamo/yii2-url-shortener)[ RSS](/packages/erosdelalamo-yii2-url-shortener/feed)WikiDiscussions master Synced 1mo ago

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

Yii2 url shortener.
===================

[](#yii2-url-shortener)

```
Do not get fooled by the age of changes made to library. It works like the first day, and that is why it has not been updated

```

Make short links within your own yii2 application. Can even define an expiration date for a shortened url. See this readme file to learn how.

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

[](#installation)

Add the module to your config file:

**First:** Run the migration included in @vendor/eseperio/yii2-url-shortener/src/migrations.

```
  //...

'modules' => [
     'shortener' => [
            'class' => \eseperio\shortener\ShortenerModule::class
        ]
  ]

  //...
```

Add the bootstrap class to your bootstrap configuration.

```
'basePath' => dirname(__DIR__),
    'bootstrap' => [
        'log',
        \eseperio\shortener\Bootstrap::class,
    ],

    'aliases' => [
    //...
```

Usage
-----

[](#usage)

Making a short link

```
Yii::$app->getModule('shortener')->short('http://original.url/goes/here')

// An array can be provided too.

Yii::$app->getModule('shortener')->short(['controller/action','param' => 'value'])
```

A lifetime can be established. Link will stop working since that date.

```
Yii::$app->getModule('shortener')->short($url, 3600)
```

Expanding a link

```
Yii::$app->getModule('shortener')->expand('link id')
```

Redirection
-----------

[](#redirection)

Module includes a controller to handle redirections. The only thing you need, to make it work, it is create a link to your app domain, followed by the short id of url.

`http://myapp.tld/gGyU`

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

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

Total

2

Last Release

1202d ago

Major Versions

0.1.0 → 1.0.02023-02-01

### Community

Maintainers

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

---

Top Contributors

[![Eseperio](https://avatars.githubusercontent.com/u/5459366?v=4)](https://github.com/Eseperio "Eseperio (10 commits)")

### Embed Badge

![Health badge](/badges/erosdelalamo-yii2-url-shortener/health.svg)

```
[![Health](https://phpackages.com/badges/erosdelalamo-yii2-url-shortener/health.svg)](https://phpackages.com/packages/erosdelalamo-yii2-url-shortener)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)

PHPackages © 2026

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