You are here

public function ResourceType::getPath in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::getPath()

Get the resource path.

Return value

string The path to access this resource type. The function replaces "--" with "/" in the URI path. Example: "node--article" -> "node/article".

See also

\Drupal\jsonapi\ResourceType\ResourceType::TYPE_NAME_URI_PATH_SEPARATOR

jsonapi.base_path

File

core/modules/jsonapi/src/ResourceType/ResourceType.php, line 442

Class

ResourceType
Value object containing all metadata for a JSON:API resource type.

Namespace

Drupal\jsonapi\ResourceType

Code

public function getPath() {
  return '/' . implode('/', explode(self::TYPE_NAME_URI_PATH_SEPARATOR, $this->typeName));
}