public function resolve(RequestInterface $request, ResponseInterface $response, Context $context) { $source = $context->get(Context::KEY_SOURCE); if (strpos($source, '::') !== false) { list($className, $method) = explode('::', $source, 2); } else { $className = $source; $method = null; } $context->set(Context::KEY_CLASS, $className); $context->set(Context::KEY_METHOD, $method); return $this->factory->getController($className, $request, $response, $context); }
/** * Can be overriden by an controller to return the formats which are * supported. All following controllers will have the same supported writers * as the origin controller. If null gets returned every available format is * supported otherwise it must return an array containing writer class names * * @return array */ protected function getSupportedWriter() { return $this->context->get(Context::KEY_SUPPORTED_WRITER); }