PHP Class Knp\Bundle\KnpBundlesBundle\Badge\BadgeGenerator

Afficher le fichier Open project: KnpLabs/KnpBundles

Protected Properties

Свойство Type Description
$cacheDir string Get app cache dir
$font string Get default font
$position array Determine score points position
$rootDir string Get app root dir
$type array Get badge type

Méthodes publiques

Méthode Description
__construct ( Imagine\Image\ImagineInterface $imagine, null | Symfony\Component\Filesystem\Filesystem $filesystem = null ) Constructor
generate ( Bundle $bundle ) Generate Badge images
setCacheDir ( string $cacheDir )
setRootDir ( string $rootDir )
show ( Bundle $bundle, string $type = 'long', boolean $regenerate = false ) : string

Méthodes protégées

Méthode Description
createBadgesDir ( ) Check and create a dir for uploaded badges
getBadgeFile ( Bundle $bundle, string $type = self::LONG ) : string Get badge image full path
getPositionByType ( integer | string $score, string $type ) : Imagine\Image\Point Get score points position x:y
getResourceDir ( ) : string
setFont ( Imagine\Image\ImagineInterface $imagine, string $font, integer $size, string $color = 'ffffff' ) : string Return full font path
shorten ( string $name, integer $length ) : string Trim long bundle name

Method Details

__construct() public méthode

Constructor
public __construct ( Imagine\Image\ImagineInterface $imagine, null | Symfony\Component\Filesystem\Filesystem $filesystem = null )
$imagine Imagine\Image\ImagineInterface
$filesystem null | Symfony\Component\Filesystem\Filesystem

createBadgesDir() protected méthode

Check and create a dir for uploaded badges
protected createBadgesDir ( )

generate() public méthode

Generate Badge images
public generate ( Bundle $bundle )
$bundle Knp\Bundle\KnpBundlesBundle\Entity\Bundle

getBadgeFile() protected méthode

Get badge image full path
protected getBadgeFile ( Bundle $bundle, string $type = self::LONG ) : string
$bundle Knp\Bundle\KnpBundlesBundle\Entity\Bundle
$type string
Résultat string

getPositionByType() protected méthode

Get score points position x:y
protected getPositionByType ( integer | string $score, string $type ) : Imagine\Image\Point
$score integer | string
$type string
Résultat Imagine\Image\Point

getResourceDir() protected méthode

protected getResourceDir ( ) : string
Résultat string

setCacheDir() public méthode

public setCacheDir ( string $cacheDir )
$cacheDir string

setFont() protected méthode

Return full font path
protected setFont ( Imagine\Image\ImagineInterface $imagine, string $font, integer $size, string $color = 'ffffff' ) : string
$imagine Imagine\Image\ImagineInterface
$font string
$size integer
$color string
Résultat string

setRootDir() public méthode

public setRootDir ( string $rootDir )
$rootDir string

shorten() protected méthode

Trim long bundle name
protected shorten ( string $name, integer $length ) : string
$name string
$length integer symbol count from the end
Résultat string

show() public méthode

public show ( Bundle $bundle, string $type = 'long', boolean $regenerate = false ) : string
$bundle Knp\Bundle\KnpBundlesBundle\Entity\Bundle
$type string
$regenerate boolean
Résultat string

Property Details

$cacheDir protected_oe property

Get app cache dir
protected string $cacheDir
Résultat string

$font protected_oe property

Get default font
protected string $font
Résultat string

$position protected_oe property

Determine score points position
protected array $position
Résultat array

$rootDir protected_oe property

Get app root dir
protected string $rootDir
Résultat string

$type protected_oe property

Get badge type
protected array $type
Résultat array