PHPackages                             x-wp/ajax-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. x-wp/ajax-router

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

x-wp/ajax-router
================

Simplifies the use of WordPress AJAX by providing NestJS inspired Controller design.

v1.0.0-alpha.2(2y ago)301[6 PRs](https://github.com/oblakstudio/wp-ajax-router/pulls)GPL-2.0-onlyPHPPHP &gt;= 8.1

Since Mar 23Pushed 1w ago1 watchersCompare

[ Source](https://github.com/oblakstudio/wp-ajax-router)[ Packagist](https://packagist.org/packages/x-wp/ajax-router)[ RSS](/packages/x-wp-ajax-router/feed)WikiDiscussions alpha Synced today

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

WordPress AJAX Router
=====================

[](#wordpress-ajax-router)

[![Packagist Version](https://camo.githubusercontent.com/44ec5dda6deafa6309010e6c4c15314f645c694f38c2f7d83a226a196fb112ec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7877702f616a61782d736572766572)](https://camo.githubusercontent.com/44ec5dda6deafa6309010e6c4c15314f645c694f38c2f7d83a226a196fb112ec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7877702f616a61782d736572766572)[![Packagist PHP Version](https://camo.githubusercontent.com/19ef409b757bef88dc0afd2bff1dda96c264f69906e3a3ca5e1f2f6c0dcc1ac4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f7877702f616a61782d7365727665722f706870)](https://camo.githubusercontent.com/19ef409b757bef88dc0afd2bff1dda96c264f69906e3a3ca5e1f2f6c0dcc1ac4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f7877702f616a61782d7365727665722f706870)[![semantic-release: angular](https://camo.githubusercontent.com/9cdd34ac7322a84f2cf0ff00d590f5cc32229560a89e898aa2c5a5eeecbd5dfc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73656d616e7469632d2d72656c656173652d616e67756c61722d6531303037393f6c6f676f3d73656d616e7469632d72656c65617365)](https://github.com/semantic-release/semantic-release)

PSR-7 / PSR-15 compatible AJAX router for WordPress.
----------------------------------------------------

[](#psr-7--psr-15-compatible-ajax-router-for-wordpress)

Inspired by [NestJS](https://nestjs.com) and [Express](https://expressjs.com) - this library provides a simple way to handle AJAX requests in WordPress.

[![Inner Platform Effect](https://camo.githubusercontent.com/28fb7afc7cd93ba9e5fcbb987887cbd0e7a189afcf1ee99c44c889687ac1a889/68747470733a2f2f66696c65732e6f626c616b2e626f742f796f2d646177672d77702d616a61782e6a7067)](https://en.wikipedia.org/wiki/Inner-platform_effect)

QuickStart
----------

[](#quickstart)

### Install the library

[](#install-the-library)

```
composer require x-wp/ajax-server
```

### Define a controller

[](#define-a-controller)

```
