| @@ -5,18 +5,25 @@ | ||
| 5 | 5 | use BitCode\BitForm\API\Controller\EntryController; |
| 6 | 6 | use WP_REST_Controller; |
| 7 | 7 | use WP_REST_Server; |
| 8 | 8 | |
| 9 | -class Routes extends WP_REST_Controller { | |
| 10 | -// public $entryController; | |
| 9 | +class Routes extends WP_REST_Controller | |
| 10 | +{ | |
| 11 | + private $entryController; | |
| 11 | 12 | |
| 12 | - public function __construct() { | |
| 13 | + protected $namespace; | |
| 14 | + | |
| 15 | + protected $rest_base; | |
| 16 | + | |
| 17 | + public function __construct() | |
| 18 | + { | |
| 13 | 19 | $this->namespace = 'bitform'; |
| 14 | 20 | $this->rest_base = 'v1'; |
| 15 | 21 | $this->entryController = new EntryController(); |
| 16 | 22 | } |
| 17 | 23 | |
| 18 | - public function register_routes() { | |
| 24 | + public function register_routes() | |
| 25 | + { | |
| 19 | 26 | /* google sheet route */ |
| 20 | 27 | register_rest_route( |
| 21 | 28 | $this->namespace, |
| 22 | 29 | $this->rest_base . '/google/', |