PHPackages                             basteyy/plates-url-toolset - 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. basteyy/plates-url-toolset

ActivePlugin

basteyy/plates-url-toolset
==========================

A few functions for url handling in plates

1.0.0(1y ago)085MITPHPPHP &gt;=8.0

Since Apr 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/basteyy/plates-url-toolset)[ Packagist](https://packagist.org/packages/basteyy/plates-url-toolset)[ RSS](/packages/basteyy-plates-url-toolset/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (7)Used By (0)

Plates URL Toolset
==================

[](#plates-url-toolset)

This plugin provides a few URL functions for use within [Plates](https://platesphp.com/) templates.

Setup
-----

[](#setup)

First, download the library via Composer:

```
composer require basteyy/plates-url-toolset
```

Of course, you can download the library manually and include it in your project. But I recommend using Composer.

Usage
-----

[](#usage)

### Load Extension

[](#load-extension)

To make the URL tools available, load the extension into your Plates scope:

```
/** @var \League\Plates\Engine $engine */
$engine->loadExtension(new \basteyy\PlatesUrlToolset\PlatesUrlToolset());
```

### Load Options

[](#load-options)

Customize the extension by setting options when loading it:

```
/** @var \League\Plates\Engine $engine */
$engine->loadExtension(
    new \basteyy\PlatesUrlToolset\PlatesUrlToolset(
        null,  // The base URL for all URLs. Should be something like https://example.org
        true,  // Change the default value for using absolute URLs
        []     // Register named URLs for later use
    ));
```

### Usages Inside the Templates

[](#usages-inside-the-templates)

For all the examples below, I use `example.org` as the hypothetical website URL.

#### Get the Current URL

[](#get-the-current-url)

```
echo $this->getCurrentUrl(); // Displays the current URL
```

Result:

```
http://example.org/foobar
```

#### Create an HTML Link

[](#create-an-html-link)

```
echo $this->getLink('/foo', 'Click it!!', 'Yes, click me', 'btn big', false);
```

Result:

```
Click it!!
```

#### Get a Named URL

[](#get-a-named-url)

```
// Register the link in the constructor or via
$this->addNamedUrl('linkname', 'foobar');

echo $this->getNamedUrl('linkname');
echo $this->getNamedUrl('linkname', true);
```

Result:

```
/foobar
https://example.org/foobar
```

#### Get a Named HTML Link

[](#get-a-named-html-link)

```
// Register the link in the constructor or via
$this->addNamedUrl('linkname', 'foobar-123456789');

echo $this->getNamedLink('linkname', 'Click it!!', 'Yes, click me', 'btn big', false);
```

Result:

```
Click it!!
```

#### Get a URL with a Debugging Timestamp Appended

[](#get-a-url-with-a-debugging-timestamp-appended)

```
// Register the link in the constructor or via
echo $this->getDebugUrl('/foobar/file/something.css');

echo $this->getDebugUrl('/foobar/file/bar.jpg', true, 'blabla', 'aaaa');
```

Result:

```
/foobar/file/something.css?request_time=1234567
(current timestamp)

https://example.org/foobar/file/bar.jpg?blabla=aaaa
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/basteyy/plates-url-toolset/blob/master/LICENSE) for more information.

Contributing
------------

[](#contributing)

Feel free to contribute to this project. Just create a pull request with your changes.

Support
-------

[](#support)

[![ko-fi](https://camo.githubusercontent.com/201ef269611db7eb6b5d08e9f756ab8980df3014b64492770bdf13a6ed924641/68747470733a2f2f6b6f2d66692e636f6d2f696d672f676974687562627574746f6e5f736d2e737667)](https://ko-fi.com/S6S6NIYIK)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

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

Recently: every ~300 days

Total

6

Last Release

572d ago

Major Versions

0.0.5 → 1.0.02024-10-14

### Community

Maintainers

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

---

Top Contributors

[![basteyy](https://avatars.githubusercontent.com/u/2758879?v=4)](https://github.com/basteyy "basteyy (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/basteyy-plates-url-toolset/health.svg)

```
[![Health](https://phpackages.com/badges/basteyy-plates-url-toolset/health.svg)](https://phpackages.com/packages/basteyy-plates-url-toolset)
```

PHPackages © 2026

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