$router = new ThemePlate\Bridge\Router( 'test' );
// `<WP_HOME>/test/route`
$router->map(
'route',
function (): bool {
// ...
}
);
// `<WP_HOME>/test/[path]`
$router->any(
'[path]',
function ( string $path ): bool {
// $path = [path]
}
);
// `<WP_HOME>/test/[filename]`
$router->load( new Loader( __DIR__ . '/templates' ) );
// only handles .php files
$router->load( new Loader( __DIR__ . '/templates', 'action' ) );
// only handles .action.php files
add_action( 'init', array( $router, 'init' ) );
-
Notifications
You must be signed in to change notification settings - Fork 0
A connection point for frontend libraries
License
ThemePlate/Bridge
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A connection point for frontend libraries
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published