protected function getView(Entity $entity, array $params = [])
    {
        switch (true) {
            case $entity instanceof ContentItem:
                $template = $entity->isIndex() ? 'index.twig' : 'entry.twig';
                $params['entry'] = $entity;
                break;
            case $entity instanceof Taxonomy:
                $template = 'taxonomy.twig';
                $params['taxonomy'] = $entity;
                break;
            case $entity instanceof Term:
                $template = 'term.twig';
                $params['term'] = $entity;
                break;
            default:
                throw new \LogicException('Cannot render entity of type '.get_class($entity));
        }

        return new View($template, $params);
    }