PHP Class Newscoop\Services\TemplatesService

Afficher le fichier Open project: sourcefabric/newscoop Class Usage Examples

Protected Properties

Свойство Type Description
$originalVector
$publicationService PublicationService Publication Service
$smarty CampTemplate
$themesService ThemesServiceInterface Themes Service

Méthodes publiques

Méthode Description
__construct ( ThemesService $themesService, PublicationService $publicationService )
fetchTemplate ( string $file, array $params = [], integer $lifetime = 1400 ) : string Fetch template with smarty
getSmarty ( ) : Smarty Get current smarty object
renderTemplate ( string $file, array $params = [], integer $lifetime = 1400, boolean $render = true ) : string Render template with smarty (will echo outupt)
setLifetime ( integer $lifetime ) Set template cache lifetime
setVector ( array $vector ) Newscoop caching save cached template file content with special vector parameters.

Private Methods

Méthode Description
assignParameters ( $params = [] )
preconfigureSmarty ( )
preconfigureVector ( )

Method Details

__construct() public méthode

public __construct ( ThemesService $themesService, PublicationService $publicationService )
$themesService ThemesService
$publicationService PublicationService

fetchTemplate() public méthode

Fetch template with smarty
public fetchTemplate ( string $file, array $params = [], integer $lifetime = 1400 ) : string
$file string template file path
$params array array with template parameters
$lifetime integer template cache lifetime (default: 1400 seconds)
Résultat string Template output

getSmarty() public méthode

Get current smarty object
public getSmarty ( ) : Smarty
Résultat Smarty

renderTemplate() public méthode

Render template with smarty (will echo outupt)
public renderTemplate ( string $file, array $params = [], integer $lifetime = 1400, boolean $render = true ) : string
$file string template file path
$params array array with template parameters
$lifetime integer template cache lifetime (default: 1400 seconds)
$render boolean render or just fetch template (default: true [render])
Résultat string Template output

setLifetime() public méthode

Set template cache lifetime
public setLifetime ( integer $lifetime )
$lifetime integer

setVector() public méthode

By default vector is filled with 6 parameters: * (int) language * (int) publication * (int) issue * (int) section * (int) article * (string) params In this service vector is allways prefilled only with publication and language values. You need to set manualny (if needed) issue, section, article or params keys
public setVector ( array $vector )
$vector array

Property Details

$originalVector protected_oe property

protected $originalVector

$publicationService protected_oe property

Publication Service
protected PublicationService,Newscoop\Services $publicationService
Résultat PublicationService

$smarty protected_oe property

protected CampTemplate $smarty
Résultat CampTemplate

$themesService protected_oe property

Themes Service
protected ThemesServiceInterface $themesService
Résultat ThemesServiceInterface