hook_rest_type_uri_alter(&$uri, $context = array())
Alter the REST type URI.
Modules may wish to alter the type URI generated for a resource based on the context of the serializer/normalizer operation.
Parameters
string $uri: The URI to alter.
array $context: The context from the serializer/normalizer operation.
See also
\Symfony\Component\Serializer\SerializerInterface::serialize()
\Symfony\Component\Serializer\SerializerInterface::deserialize()
\Symfony\Component\Serializer\NormalizerInterface::normalize()
\Symfony\Component\Serializer\DenormalizerInterface::denormalize()
Related topics
- Hooks
- Define functions that alter the behavior of Drupal core.
File
- core/modules/rest/rest.api.php, line 47
- Describes hooks provided by the RESTful Web Services module.
Code
1 2 3 4 5 6 | function hook_rest_type_uri_alter(& $uri , $context = array ()) { if ( $context [ 'mymodule' ] == TRUE) { $base = \Drupal::config( 'rest.settings' )->get( 'link_domain' ); } } |
Please login to continue.