PHPackages                             cowshed/router - 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. cowshed/router

ActiveLibrary

cowshed/router
==============

WP Routes

0.0.5-alpha(5y ago)03MITPHP

Since Mar 13Pushed 5y agoCompare

[ Source](https://github.com/Cowshed-Communication/router)[ Packagist](https://packagist.org/packages/cowshed/router)[ RSS](/packages/cowshed-router/feed)WikiDiscussions main Synced 4d ago

READMEChangelog (4)DependenciesVersions (7)Used By (0)

WordPress Router
================

[](#wordpress-router)

This package allows you to register hard-coded WordPress pages.

Under the hood, it creates CMS-based pages which are stored in the database.

This package is very useful for plugins or themes which have pre-determined content, such as dashboards with their own templates on a specific route.

Usage
-----

[](#usage)

To prevent any unintended behaviour, use this package's functionality inside the `init` hook.

Register Routes:

```
add_action( 'init', function () {
    $router = new Router();
    $router->route( [
        'name'     => 'home', // slug my-custom-route
        'template' => 'views/template-home.blade.php', // template path
        'ref'      => 'home', // reference for URL fetching
    ] )->route( [
        'name'     => 'about us',
        'template' => 'views/template-about.blade.php',
        'ref'      => 'about',
    ] )->bind();
} );
```

Get a route URL:

```
\Cowshed\Router\Router::url('test')
```

Most methods in the Router class are chainable.

Methods
-------

[](#methods)

### route

[](#route)

Add a route to the list.

Params:

- route - Array - containing `name`, `template` &amp; `ref` keys.

Return:

- Router instance

### bind

[](#bind)

Create pages for the routes.

Return:

- Router instance

### url - static

[](#url---static)

Fetch the URL for a specified route.

Params:

- ref - String - The route reference as specified in the `route` call.

Return:

- mixed string|False- url if found, false if not.

### errors

[](#errors)

Return an array of errors and notices.

Return:

- Array - list of errors &amp; notices.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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

Every ~0 days

Total

4

Last Release

1888d ago

### Community

Maintainers

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

---

Top Contributors

[![Joe-Cowshed](https://avatars.githubusercontent.com/u/72020384?v=4)](https://github.com/Joe-Cowshed "Joe-Cowshed (9 commits)")

### Embed Badge

![Health badge](/badges/cowshed-router/health.svg)

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

PHPackages © 2026

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