PHPackages                             wpdiggerstudio/wpzylos-routing - 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. [Framework](/categories/framework)
4. /
5. wpdiggerstudio/wpzylos-routing

ActiveLibrary[Framework](/categories/framework)

wpdiggerstudio/wpzylos-routing
==============================

FastRoute-based routing with WordPress rewrite integration for WPZylos framework

v1.0.0(3mo ago)02341MITPHPPHP ^8.0CI passing

Since Feb 1Pushed 3mo agoCompare

[ Source](https://github.com/WPDiggerStudio/wpzylos-routing)[ Packagist](https://packagist.org/packages/wpdiggerstudio/wpzylos-routing)[ Docs](https://github.com/WPDiggerStudio/wpzylos-routing)[ Fund](https://www.paypal.com/donate/?hosted_button_id=66U4L3HG4TLCC)[ RSS](/packages/wpdiggerstudio-wpzylos-routing/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (1)

WPZylos Routing
===============

[](#wpzylos-routing)

[![PHP Version](https://camo.githubusercontent.com/911a83e2aa6fe73660ab613629a95c76622bf03049a7344e80c5ea72d4ef9c7d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e302d626c7565)](https://php.net)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)[![GitHub](https://camo.githubusercontent.com/dbe820b98864e115173c422b9472b725cfa678bee03b66ff2c453dad95a3d20b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769744875622d575044696767657253747564696f2d3138313731373f6c6f676f3d676974687562)](https://github.com/WPDiggerStudio/wpzylos-routing)

Full-featured routing package for WordPress with frontend routes, REST API endpoints, and AJAX actions.

📖 **[Full Documentation](https://wpzylos.com)** | 🐛 **[Report Issues](https://github.com/WPDiggerStudio/wpzylos-routing/issues)**

---

✨ Features
----------

[](#-features)

- **Frontend Routing** — Custom URL patterns with WordPress rewrite integration
- **REST API Routing** — Fluent API for `/wp-json/` endpoints
- **AJAX Routing** — Automatic action registration with nonce verification
- **Route Groups** — Shared prefixes and middleware
- **Middleware Pipeline** — PSR-15 style middleware support
- **Named Routes** — URL generation from route names
- **Resource Routes** — CRUD endpoint scaffolding

---

📋 Requirements
--------------

[](#-requirements)

RequirementVersionPHP^8.0WordPress6.0+---

🚀 Installation
--------------

[](#-installation)

```
composer require wpdiggerstudio/wpzylos-routing
```

---

📖 Quick Start
-------------

[](#-quick-start)

Register the service provider in your plugin:

```
use WPZylos\Framework\Routing\RoutingServiceProvider;

$app->register(new RoutingServiceProvider());
```

Create route files in your plugin's `routes/` directory:

FilePurpose`routes/web.php`Frontend routes`routes/api.php`REST API routes`routes/ajax.php`AJAX routes---

🌐 Frontend Routing
------------------

[](#-frontend-routing)

```
// routes/web.php
return function (\WPZylos\Framework\Routing\Router $router) {
    $router->get('/products', [ProductController::class, 'index']);
    $router->get('/products/{id}', [ProductController::class, 'show'])
        ->where('id', '[0-9]+');

    $router->group(['prefix' => '/admin', 'middleware' => ['auth']], function ($router) {
        $router->get('/dashboard', [AdminController::class, 'dashboard']);
    });
};
```

---

🔌 REST API Routing
------------------

[](#-rest-api-routing)

```
// routes/api.php
return function (\WPZylos\Framework\Routing\RestRouter $rest) {
    // GET /wp-json/my-plugin/v1/users
    $rest->get('/users', [UserController::class, 'index']);

    // With permission
    $rest->post('/users', [UserController::class, 'store'])
        ->permission('edit_users');

    // Resource routes (CRUD)
    $rest->resource('posts', PostController::class);
};
```

---

⚡ AJAX Routing
--------------

[](#-ajax-routing)

```
// routes/ajax.php
return function (\WPZylos\Framework\Routing\AjaxRouter $ajax) {
    // Private: requires login
    $ajax->private('save_settings', [SettingsController::class, 'save']);

    // Public: works without login
    $ajax->public('search', [SearchController::class, 'handle']);
};
```

---

🛡️ Middleware
-------------

[](#️-middleware)

```
class AuthMiddleware
{
    public function handle($request, callable $next): mixed
    {
        if (!is_user_logged_in()) {
            return new \WP_Error('unauthorized', 'Login required', ['status' => 401]);
        }
        return $next($request);
    }
}

// Apply to routes
$router->get('/dashboard', [Controller::class, 'index'])
    ->middleware(AuthMiddleware::class);
```

---

📦 Related Packages
------------------

[](#-related-packages)

PackageDescription[wpzylos-core](https://github.com/WPDiggerStudio/wpzylos-core)Application foundation[wpzylos-container](https://github.com/WPDiggerStudio/wpzylos-container)PSR-11 dependency injection[wpzylos-http](https://github.com/WPDiggerStudio/wpzylos-http)Request/Response handling[wpzylos-scaffold](https://github.com/WPDiggerStudio/wpzylos-scaffold)Plugin template---

� Documentation
---------------

[](#-documentation)

For comprehensive documentation, tutorials, and API reference, visit **[wpzylos.com](https://wpzylos.com)**.

---

☕ Support the Project
---------------------

[](#-support-the-project)

If you find this package helpful, consider buying me a coffee! Your support helps maintain and improve the WPZylos ecosystem.

[ ![Donate with PayPal](https://camo.githubusercontent.com/ab874f7381c27789efc0a8502714f480bb5ddcc2de7008417d26b5069068341c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d626c75652e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d70617970616c)](https://www.paypal.com/donate/?hosted_button_id=66U4L3HG4TLCC)---

📄 License
---------

[](#-license)

MIT License. See [LICENSE](LICENSE) for details.

---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

---

**Made with ❤️ by [WPDiggerStudio](https://github.com/WPDiggerStudio)**

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance86

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

97d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/87be74120ef333e9f794308da1fdcb9505f3e1b255926014a144e6360bb29c08?d=identicon)[WPDiggerStudio](/maintainers/WPDiggerStudio)

---

Top Contributors

[![WPDiggerStudio](https://avatars.githubusercontent.com/u/55980087?v=4)](https://github.com/WPDiggerStudio "WPDiggerStudio (2 commits)")

---

Tags

middlewarewordpressroutingajaxREST APIFastRoutewpzylos

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wpdiggerstudio-wpzylos-routing/health.svg)

```
[![Health](https://phpackages.com/badges/wpdiggerstudio-wpzylos-routing/health.svg)](https://phpackages.com/packages/wpdiggerstudio-wpzylos-routing)
```

###  Alternatives

[hprose/hprose

It is a modern, lightweight, cross-language, cross-platform, object-oriented, high performance, remote dynamic communication middleware. It is not only easy to use, but powerful. You just need a little time to learn, then you can use it to easily construct cross language cross platform distributed application system.

2.1k215.3k37](/packages/hprose-hprose)[htmlburger/wpemerge

A micro framework which modernizes WordPress as a CMS development by providing tools to implement MVC and more.

456137.8k8](/packages/htmlburger-wpemerge)[luthier/luthier

Improved routing, middleware support, authentication tools and more for CodeIgniter 3 framework

150108.8k](/packages/luthier-luthier)[devio/permalink

Permalink routing system for Laravel. Advanced database driven routes. Handle your permalinks + SEO parameters directly from database.

664.7k](/packages/devio-permalink)[hprose/hprose-yii

Hprose Server for Yii 2

357.1k](/packages/hprose-hprose-yii)

PHPackages © 2026

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