PHP 클래스 Newscoop\Services\TemplatesService

파일 보기 프로젝트 열기: sourcefabric/newscoop 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$originalVector
$publicationService PublicationService Publication Service
$smarty CampTemplate
$themesService ThemesServiceInterface Themes Service

공개 메소드들

메소드 설명
__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.

비공개 메소드들

메소드 설명
assignParameters ( $params = [] )
preconfigureSmarty ( )
preconfigureVector ( )

메소드 상세

__construct() 공개 메소드

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

fetchTemplate() 공개 메소드

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)
리턴 string Template output

getSmarty() 공개 메소드

Get current smarty object
public getSmarty ( ) : Smarty
리턴 Smarty

renderTemplate() 공개 메소드

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])
리턴 string Template output

setLifetime() 공개 메소드

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

setVector() 공개 메소드

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

프로퍼티 상세

$originalVector 보호되어 있는 프로퍼티

protected $originalVector

$publicationService 보호되어 있는 프로퍼티

Publication Service
protected PublicationService,Newscoop\Services $publicationService
리턴 PublicationService

$smarty 보호되어 있는 프로퍼티

protected CampTemplate $smarty
리턴 CampTemplate

$themesService 보호되어 있는 프로퍼티

Themes Service
protected ThemesServiceInterface $themesService
리턴 ThemesServiceInterface