| 1 |
<?php |
| 2 |
/** |
| 3 |
* REST API bootstrap. |
| 4 |
* |
| 5 |
* @package SpringDevs\Subscription |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace SpringDevs\Subscription; |
| 9 |
|
| 10 |
use SpringDevs\Subscription\Api\PlanController; |
| 11 |
|
| 12 |
/** |
| 13 |
* API Class |
| 14 |
*/ |
| 15 |
class API { |
| 16 |
|
| 17 |
|
| 18 |
/** |
| 19 |
* Initialize the class |
| 20 |
*/ |
| 21 |
public function __construct() { |
| 22 |
add_action( 'rest_api_init', array( $this, 'register_api' ) ); |
| 23 |
} |
| 24 |
|
| 25 |
/** |
| 26 |
* Register the API |
| 27 |
* |
| 28 |
* @return void |
| 29 |
*/ |
| 30 |
public function register_api() { |
| 31 |
( new PlanController() )->register_routes(); |
| 32 |
} |
| 33 |
} |
| 34 |
|