Sonata\ProductBundle\Menu\ProductMenuBuilder::getCategoryTitle PHP Method

getCategoryTitle() protected method

Gets the HTML associated with the category menu title.
protected getCategoryTitle ( Sonata\ClassificationBundle\Model\CategoryInterface $category, integer $limit = 500 ) : string
$category Sonata\ClassificationBundle\Model\CategoryInterface A category instance
$limit integer A limit for calculation (fixed to 500 by default)
return string
    protected function getCategoryTitle(CategoryInterface $category, $limit = 500)
    {
        $count = $this->categoryManager->getProductCount($category, $limit);
        return sprintf('%s <span class="badge pull-right">%d%s</span>', $category->getName(), $count, $count > $limit ? '+' : '');
    }