PHP code example of sau / wp_route
1. Go to this page and download the library: Download sau/wp_route library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sau / wp_route example snippets
add_action( 'sau_simple_route', function ( RouteCollector $r ) {
$r->addRoute( [ 'POST', 'GET' ], '/auth', 'User.logIn' );
// Регистрация ваших роутов...
} );