public function createView(string $class, string $method): View
    {
        if (false === method_exists($class, $method)) {
            throw new Exception('Could not create view');
        }

        $reflection = $this->container->getFactory($class)->getReflection();

        if (null === ($view = $reflection->getAnnotation('view', $method, null))) {
            throw new Exception('No view defined for ' . $class . '::' . $method);
        }

        if (class_exists($view)) {
            return new View($view);
        }

        $directory = realpath(dirname($reflection->getFileName()) . '/../' . self::DEFAULT_VIEW_PATH);
        $directory = $reflection->getAnnotation('viewPath', $method, $directory);

        $template = str_replace('/', DIRECTORY_SEPARATOR, $directory . '/' . $view);

        return $this->createViewFromTemplate($template);
    }