PHP 클래스 Contao\Combiner

Usage: $combiner = new Combiner(); $combiner->add('css/style.css'); $combiner->add('css/fonts.scss'); $combiner->add('css/print.less'); echo $combiner->getCombinedFile();
상속: extends System
파일 보기 프로젝트 열기: contao/core-bundle 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$arrFiles array Files
$strKey string Unique file key
$strMode string Operation mode

공개 메소드들

메소드 설명
__construct ( ) Public constructor required
add ( string $strFile, string $strVersion = null, string $strMedia = 'all' ) Add a file to the combined file
addMultiple ( array $arrFiles, string $strVersion = null, string $strMedia = 'screen' ) Add multiple files from an array
getCombinedFile ( string $strUrl = null ) : string Generate the combined file and return its path
getFileUrls ( ) : array Generates the files and returns the URLs.
hasEntries ( ) : boolean Check whether files have been added

보호된 메소드들

메소드 설명
fixPaths ( string $content, array $arrFile ) : string Fix the paths
getCombinedFileUrl ( string $strUrl = null ) : string Generate the combined file and return its path
getDebugMarkup ( ) : string Generates the debug markup.
handleCss ( string $content, array $arrFile ) : string Handle CSS files
handleScssLess ( string $content, array $arrFile ) : string Handle SCSS/LESS files

메소드 상세

__construct() 공개 메소드

Public constructor required
public __construct ( )

add() 공개 메소드

Add a file to the combined file
public add ( string $strFile, string $strVersion = null, string $strMedia = 'all' )
$strFile string The file to be added
$strVersion string An optional version number
$strMedia string The media type of the file (.css only)

addMultiple() 공개 메소드

Add multiple files from an array
public addMultiple ( array $arrFiles, string $strVersion = null, string $strMedia = 'screen' )
$arrFiles array An array of files to be added
$strVersion string An optional version number
$strMedia string The media type of the file (.css only)

fixPaths() 보호된 메소드

Fix the paths
protected fixPaths ( string $content, array $arrFile ) : string
$content string The file content
$arrFile array The file array
리턴 string The modified file content

getCombinedFile() 공개 메소드

Generate the combined file and return its path
public getCombinedFile ( string $strUrl = null ) : string
$strUrl string An optional URL to prepend
리턴 string The path to the combined file

getCombinedFileUrl() 보호된 메소드

Generate the combined file and return its path
protected getCombinedFileUrl ( string $strUrl = null ) : string
$strUrl string An optional URL to prepend
리턴 string The path to the combined file

getDebugMarkup() 보호된 메소드

Generates the debug markup.
protected getDebugMarkup ( ) : string
리턴 string The debug markup

getFileUrls() 공개 메소드

Generates the files and returns the URLs.
public getFileUrls ( ) : array
리턴 array The file URLs

handleCss() 보호된 메소드

Handle CSS files
protected handleCss ( string $content, array $arrFile ) : string
$content string The file content
$arrFile array The file array
리턴 string The modified file content

handleScssLess() 보호된 메소드

Handle SCSS/LESS files
protected handleScssLess ( string $content, array $arrFile ) : string
$content string The file content
$arrFile array The file array
리턴 string The modified file content

hasEntries() 공개 메소드

Check whether files have been added
public hasEntries ( ) : boolean
리턴 boolean True if there are files

프로퍼티 상세

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

Files
protected array $arrFiles
리턴 array

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

Unique file key
protected string $strKey
리턴 string

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

Operation mode
protected string $strMode
리턴 string