src/Zf2Forum/Controller/DiscussController.php
public function getTag()
    {
        if (null !== $this->tag) {
            return $this->tag;
        }

        $categoryId = $this->getEvent()->getRouteMatch()->getParam('categoryid');
        if (is_numeric($categoryId)) {
            return $this->tag = $this->getDiscussService()->getCategoryById($categoryId);
        }

        // Find category by topic
        $topicId = $this->getEvent()->getRouteMatch()->getParam('topicid');
        if (is_numeric($topicId)) {
            // Fetch the topic
            $topic = $this->getDiscussService()->getTopicById($topicId);

            // Fetch the category
            return $this->tag = $this->getDiscussService()->getCategoryById($topic->getforumCategoryId());
        }

        return false;
    }
public function getTag()
    {
        if (null !== $this->tag) {
            return $this->tag;
        }

        $categoryId = $this->getEvent()->getRouteMatch()->getParam('categoryid');
        if (is_numeric($categoryId)) {
            return $this->tag = $this->getDiscussService()->getCategoryById($categoryId);
        }

        // Find category by topic
        $topicId = $this->getEvent()->getRouteMatch()->getParam('topicid');
        if (is_numeric($topicId)) {
            // Fetch the topic
            $topic = $this->getDiscussService()->getTopicById($topicId);

            // Fetch the category
            return $this->tag = $this->getDiscussService()->getCategoryById($topic->getforumCategoryId());
        }

        return false;
    }
Retrieve the category by the set url

@access public
@author Stijn
@version 1.0.0
@return boolean / CategoryInterface