Volkszaehler\Router::handler PHP Method

handler() public method

Example: http://sub.domain.local/middleware.php/channel/550e8400-e29b-11d4-a716-446655440000/data.json?operation=edit&title=New Title
public handler ( Request $request, $context, $uuid )
$request Symfony\Component\HttpFoundation\Request
    function handler(Request $request, $context, $uuid)
    {
        // get controller operation
        if (null === ($operation = $request->query->get('operation'))) {
            $operation = self::$operationMapping[$request->getMethod()];
        }
        $class = self::$controllerMapping[$context];
        $controller = new $class($request, $this->em, $this->view);
        $result = $controller->run($operation, $uuid);
        $this->view->add($result);
        return $this->view->send();
    }