Knp\Bundle\KnpBundlesBundle\Badge\BadgeGenerator::show PHP Method

show() public method

public show ( Bundle $bundle, string $type = 'long', boolean $regenerate = false ) : string
$bundle Knp\Bundle\KnpBundlesBundle\Entity\Bundle
$type string
$regenerate boolean
return string
    public function show(Bundle $bundle, $type = 'long', $regenerate = false)
    {
        $relativePath = $this->filesystem->makePathRelative($this->cacheDir, $this->rootDir);
        $filename = sprintf('%sbadges/%s/%s-%s.png', $relativePath, $type, $bundle->getOwnerName(), $bundle->getName());
        if (false !== $regenerate || !$this->filesystem->exists($filename)) {
            $this->generate($bundle);
        }
        return $filename;
    }