PluginProbe
The Innovative Form Builder – IvyForms / 0.5
The Innovative Form Builder – IvyForms v0.5
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Routes / Routes.php

Routes.php in The Innovative Form Builder – IvyForms 0.5, at backend/src/Routes/Routes.php

60 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * @copyright © TMS-Plugins. All rights.
5 * @licence See LICENCE.md for license details.
6 */
7
8 namespace IvyForms\Routes;
9
10 // phpcs:disable PSR1.Files.SideEffects
11 if (!defined('ABSPATH')) {
12 exit; // Exit if accessed directly
13 }
14
15 use IvyForms\Vendor\DI\Container;
16 use IvyForms\Vendor\DI\DependencyException;
17 use IvyForms\Vendor\DI\NotFoundException;
18 use IvyForms\Routes\Confirmation\Confirmation;
19 use IvyForms\Routes\Entry\Entry;
20 use IvyForms\Routes\Form\Form;
21 use IvyForms\Routes\Notification\Notification;
22 use IvyForms\Routes\Template\Template;
23 use IvyForms\Routes\Settings\Settings;
24 use IvyForms\Routes\Changelog\Changelog;
25
26 /**
27 * Class Routes
28 *
29 * @package IvyForms\Routes
30 */
31 class Routes
32 {
33 public static string $routeNamespace = 'ivyforms/v1';
34
35 /**
36 * @throws DependencyException
37 * @throws NotFoundException
38 */
39 public static function registerRoutes(Container $container): void
40 {
41 Form::registerRoutes($container, self::$routeNamespace);
42 Notification::registerRoutes($container, self::$routeNamespace);
43 Confirmation::registerRoutes($container, self::$routeNamespace);
44 Entry::registerRoutes($container, self::$routeNamespace);
45 Template::registerRoutes($container, self::$routeNamespace);
46 Settings::registerRoutes($container, self::$routeNamespace);
47 Changelog::registerRoutes($container, self::$routeNamespace);
48
49 /**
50 * Allow external plugins/components to register additional routes.
51 * @since 0.1.0
52 *
53 * Args:
54 * - Container $container The IvyForms DI container (base)
55 * - string $namespace Current REST namespace string (e.g. ivyforms/v1)
56 */
57 do_action('ivyforms/rest/register_additional_routes', $container, self::$routeNamespace);
58 }
59 }
60