Rest_Controller

Summary

No summary available.

Source

File: src/BigCommerce/Rest/Rest_Controller.php

class Rest_Controller extends \WP_REST_Controller {
	protected $namespace_base;
	protected $version;

	/**
	 * Rest_Controller constructor.
	 *
	 * @param string $namespace_base
	 * @param string $version
	 * @param string $rest_base
	 */
	public function __construct( $namespace_base, $version, $rest_base ) {
		$this->namespace_base = $namespace_base;
		$this->version        = $version;

		$this->namespace = $this->get_namespace();
		$this->rest_base = $rest_base;
	}

	protected function get_namespace() {
		return $this->namespace_base . '/v' . $this->version;
	}

	public function get_base_url() {
		return rest_url() . $this->namespace . '/' . $this->rest_base;
	}
}

Methods


User Contributed Notes

You must log in before being able to contribute a note or feedback.