You are here

public function ResourceInterface::getControllerFromPath in RESTful 7.2

Return the controller for a given path.

Parameters

string $path: (optional) The path to use. If none is provided the path from the resource will be used.

ResourceInterface $resource: (optional) Use the passed in resource instead of $this. This is mainly used by decorator resources.

Return value

callable A callable as expected by ResourceManager::executeCallback.

Throws

BadRequestException

ForbiddenException

GoneException

NotImplementedException

ServerConfigurationException

See also

ResourceManager::executeCallback()

2 methods override ResourceInterface::getControllerFromPath()
Resource::getControllerFromPath in src/Plugin/resource/Resource.php
Return the controller for a given path.
ResourceDecoratorBase::getControllerFromPath in src/Plugin/resource/Decorators/ResourceDecoratorBase.php
Return the controller for a given path.

File

src/Plugin/resource/ResourceInterface.php, line 320
Contains \Drupal\restful\Plugin\resource\ResourceInterface.

Class

ResourceInterface
Interface ResourceInterface.

Namespace

Drupal\restful\Plugin\resource

Code

public function getControllerFromPath($path = NULL, ResourceInterface $resource = NULL);