PHPackages                             vendi-advertising/vendi-template-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. [Templating &amp; Views](/categories/templating)
4. /
5. vendi-advertising/vendi-template-router

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

vendi-advertising/vendi-template-router
=======================================

WordPress template router

1.3.7(5y ago)11091MITPHPPHP &gt;=5.3.0

Since Mar 10Pushed 5y ago1 watchersCompare

[ Source](https://github.com/vendi-advertising/vendi-template-router)[ Packagist](https://packagist.org/packages/vendi-advertising/vendi-template-router)[ Docs](https://github.com/vendi-advertising/vendi-template-router)[ RSS](/packages/vendi-advertising-vendi-template-router/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (8)Dependencies (3)Versions (10)Used By (1)

README
======

[](#readme)

The goal of this plugin was to better override WordPress's routing engine in a more explicit and controlled manner. There are times when you want the full power of WordPress's CMS backend but you want to take complete control of the rendering. Usually this scenario pops up most when you are developing an *application* instead of just a *website*.

At the time that this plugin was created the REST API was just entering beta and the work on the rewrite engine wasn't spoken of yet. (Hopefully that's coming soon, though!)

The general use-case for this plugin is for URL "folders" that you want to redirect to your own template folder based on name. For instance, if you want everything at `https://www.example.com/app/` to go to your own application folder (which doesn't even need to live in the web root).

This plugin can be installed as a normal plugin however it is recommended that you actually install this as an MU plugin.

To use this plugin you just need to register your route:

```
\Vendi\Shared\template_router::register_context(
                                                ,
                                                ,
                                                ,
                                                ,

                                            );

```

- &lt;context\_name&gt;
    - Arbitrary string name that represents URLs relative to &lt;url\_folder&gt;.
    - If you want to ask the `template_router` to generate URLs later you'll need this.
- &lt;url\_folder&gt;
    - Arbitrary valid URL string that represents the "folder" that your application is served from.
- &lt;template\_location\_root&gt;
    - The absolute path that requests to &lt;url\_folder&gt; will be passed to.
- &lt;magic\_page&gt;
    - When passing the requested route to your template this query string variable will be used.
    - Make sure that your app does not depend on this value.
    - This value is optional and defaults to "page".
    - This parameter is poorly named and really should be "internal\_query\_string\_key" or something.
- &lt;template\_subfolder&gt;
    - The subfolder relative to &lt;template\_location\_root&gt; that holds the templates for this route.
    - This value is optional and defaults to "templates"

Example
=======

[](#example)

For a general application called `Test` that you want to have all routes start with `test` and with the WordPress install at `/var/www/wordpress-root-folder/` and with templates living in `/var/www/wordpress-root-folder/templates/` you would register your context using:

```
\Vendi\Shared\template_router::register_context(
                                                'Test',
                                                'test',
                                                '/var/www/wordpress-root-folder/'
                                            );

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

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

Recently: every ~257 days

Total

9

Last Release

2115d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7748460?v=4)[Chris Haas](/maintainers/cjhaas)[@cjhaas](https://github.com/cjhaas)

---

Top Contributors

[![cjhaas](https://avatars.githubusercontent.com/u/7748460?v=4)](https://github.com/cjhaas "cjhaas (17 commits)")

---

Tags

vendivendi-advertising

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vendi-advertising-vendi-template-router/health.svg)

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

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.0k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.2k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

281.8k](/packages/webkinder-sproutset)

PHPackages © 2026

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