PHP Класс FluidTYPO3\Vhs\Asset

Class to create Assets in PHP. ### Examples: $asset = $this->objectManager->get('FluidTYPO3\\Vhs\\Asset'); OR you can use the static factory method which works anywhere including outside of Extbase. $asset = \FluidTYPO3\Vhs\Asset::getInstance(); $asset->setPath('fileadmin/test.js')->setStandalone(TRUE)->finalize(); Or simply: $this->objectManager->get('FluidTYPO3\\Vhs\\Asset')->setPath('...')->finalize(); And you can create clean instances: Depending on how you need to access the Asset afterwards, you will want wo switch between these methods. Or if you have all settings in an array (with members named according to the properties on this class: \FluidTYPO3\Vhs\Asset::createFromSettings($settings)->finalize(); Finally, if your Asset is file based, VHS can perform a few detections to set initial attributes like standalone, external (if file contains protocol), type (based on extension) and name (base name of file). \FluidTYPO3\Vhs\Asset::createFromFile($filePathAndFilename); \FluidTYPO3\Vhs\Asset::createFromUrl($urlToExternalFile); You can chain all setters on the class before finally calling finalize() to register the Asset (you can still modify the Asset afterwards, but an Asset that has not been finalize()'ed will never show up or be processed - which is a lot friendlier than requiring you to use remove() on unwanted Assets). > Note: the "createFrom..." suite of methods automatically calls finalize() > on your Asset just before returning it. You can of course keep modifying > the instance after it is returned - but when using a "createFrom"... method > VHS assumes you always want your Asset included in the output.
Наследование: implements FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$configurationManager TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
$content string
$dependencies array
$external boolean
$fluid boolean
$movable boolean
$name string
$namedChunks boolean
$path string
$removed boolean
$rewrite boolean
$settings array
$standalone boolean
$type string
$variables array

Открытые методы

Метод Описание
assertAddNameCommentWithChunk ( ) : boolean Returns TRUE if settings specify that the name of each Asset should be placed above the built content when placed in merged Asset cache files.
assertAllowedInFooter ( ) : boolean
assertDebugEnabled ( ) : boolean Returns TRUE if the current Asset should be debugged as commanded by settings in TypoScript an/ord ViewHelper attributes.
assertFluidEnabled ( ) : boolean Returns TRUE of settings specify that the source of this Asset should be rendered as if it were a Fluid template, using variables from the "arguments" attribute
assertHasBeenRemoved ( ) : boolean
build ( ) : mixed Build this asset. Override this method in the specific implementation of an Asset in order to:
createFromContent ( string $content ) : Asset
createFromFile ( string $filePathAndFilename ) : Asset
createFromSettings ( array $settings ) : Asset
createFromUrl ( string $url ) : Asset
finalize ( ) : Asset
getAssetSettings ( ) : array
getContent ( ) : string
getDebugInformation ( ) : array Allows public access to debug this particular Asset instance later, when including the Asset in the page.
getDependencies ( ) : array
getExternal ( ) : boolean
getFluid ( ) : boolean
getInstance ( ) : Asset
getMovable ( ) : boolean
getName ( ) : string
getNamedChunks ( ) : boolean
getPath ( ) : string
getRemoved ( ) : boolean
getRewrite ( ) : boolean
getSettings ( ) : array Returns the settings used by this particular Asset during inclusion. Public access allows later inspection of the TypoScript values which were applied to the Asset.
getStandalone ( ) : boolean
getType ( ) : string
getVariables ( ) : array
injectConfigurationManager ( TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager ) : void
remove ( ) : Asset
render ( ) : mixed Render method
setContent ( string $content ) : Asset
setDependencies ( array $dependencies ) : Asset
setExternal ( boolean $external ) : Asset
setFluid ( boolean $fluid ) : Asset
setMovable ( boolean $movable )
setName ( string $name ) : Asset
setNamedChunks ( boolean $namedChunks ) : Asset
setPath ( string $path ) : Asset
setRemoved ( boolean $removed ) : Asset
setRewrite ( boolean $rewrite ) : Asset
setSettings ( array $settings ) : Asset
setStandalone ( boolean $standalone ) : Asset
setType ( string $type ) : Asset
setVariables ( array $variables ) : Asset

Описание методов

assertAddNameCommentWithChunk() публичный Метод

Returns TRUE if settings specify that the name of each Asset should be placed above the built content when placed in merged Asset cache files.
public assertAddNameCommentWithChunk ( ) : boolean
Результат boolean

assertAllowedInFooter() публичный Метод

public assertAllowedInFooter ( ) : boolean
Результат boolean

assertDebugEnabled() публичный Метод

Returns TRUE if the current Asset should be debugged as commanded by settings in TypoScript an/ord ViewHelper attributes.
public assertDebugEnabled ( ) : boolean
Результат boolean

assertFluidEnabled() публичный Метод

Returns TRUE of settings specify that the source of this Asset should be rendered as if it were a Fluid template, using variables from the "arguments" attribute
public assertFluidEnabled ( ) : boolean
Результат boolean

assertHasBeenRemoved() публичный Метод

public assertHasBeenRemoved ( ) : boolean
Результат boolean

build() публичный Метод

- if necessary compile the Asset (LESS, SASS, CoffeeScript etc) - make a final rendering decision based on arguments Note that within this function the ViewHelper and TemplateVariable Containers are not dependable, you cannot use the ControllerContext and RenderingContext and you should therefore also never call renderChildren from within this function. Anything else goes; CLI commands to build, caching implementations - you name it.
public build ( ) : mixed
Результат mixed

createFromContent() публичный статический Метод

public static createFromContent ( string $content ) : Asset
$content string
Результат Asset

createFromFile() публичный статический Метод

public static createFromFile ( string $filePathAndFilename ) : Asset
$filePathAndFilename string
Результат Asset

createFromSettings() публичный статический Метод

public static createFromSettings ( array $settings ) : Asset
$settings array
Результат Asset

createFromUrl() публичный статический Метод

public static createFromUrl ( string $url ) : Asset
$url string
Результат Asset

finalize() публичный Метод

public finalize ( ) : Asset
Результат Asset

getAssetSettings() публичный Метод

public getAssetSettings ( ) : array
Результат array

getContent() публичный Метод

public getContent ( ) : string
Результат string

getDebugInformation() публичный Метод

Allows public access to debug this particular Asset instance later, when including the Asset in the page.
public getDebugInformation ( ) : array
Результат array

getDependencies() публичный Метод

public getDependencies ( ) : array
Результат array

getExternal() публичный Метод

public getExternal ( ) : boolean
Результат boolean

getFluid() публичный Метод

public getFluid ( ) : boolean
Результат boolean

getInstance() публичный статический Метод

public static getInstance ( ) : Asset
Результат Asset

getMovable() публичный Метод

public getMovable ( ) : boolean
Результат boolean

getName() публичный Метод

public getName ( ) : string
Результат string

getNamedChunks() публичный Метод

public getNamedChunks ( ) : boolean
Результат boolean

getPath() публичный Метод

public getPath ( ) : string
Результат string

getRemoved() публичный Метод

public getRemoved ( ) : boolean
Результат boolean

getRewrite() публичный Метод

public getRewrite ( ) : boolean
Результат boolean

getSettings() публичный Метод

Returns the settings used by this particular Asset during inclusion. Public access allows later inspection of the TypoScript values which were applied to the Asset.
public getSettings ( ) : array
Результат array

getStandalone() публичный Метод

public getStandalone ( ) : boolean
Результат boolean

getType() публичный Метод

public getType ( ) : string
Результат string

getVariables() публичный Метод

public getVariables ( ) : array
Результат array

injectConfigurationManager() публичный Метод

public injectConfigurationManager ( TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager ) : void
$configurationManager TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
Результат void

remove() публичный Метод

public remove ( ) : Asset
Результат Asset

render() публичный Метод

Render method
public render ( ) : mixed
Результат mixed

setContent() публичный Метод

public setContent ( string $content ) : Asset
$content string
Результат Asset

setDependencies() публичный Метод

public setDependencies ( array $dependencies ) : Asset
$dependencies array
Результат Asset

setExternal() публичный Метод

public setExternal ( boolean $external ) : Asset
$external boolean
Результат Asset

setFluid() публичный Метод

public setFluid ( boolean $fluid ) : Asset
$fluid boolean
Результат Asset

setMovable() публичный Метод

public setMovable ( boolean $movable )
$movable boolean

setName() публичный Метод

public setName ( string $name ) : Asset
$name string
Результат Asset

setNamedChunks() публичный Метод

public setNamedChunks ( boolean $namedChunks ) : Asset
$namedChunks boolean
Результат Asset

setPath() публичный Метод

public setPath ( string $path ) : Asset
$path string
Результат Asset

setRemoved() публичный Метод

public setRemoved ( boolean $removed ) : Asset
$removed boolean
Результат Asset

setRewrite() публичный Метод

public setRewrite ( boolean $rewrite ) : Asset
$rewrite boolean
Результат Asset

setSettings() публичный Метод

public setSettings ( array $settings ) : Asset
$settings array
Результат Asset

setStandalone() публичный Метод

public setStandalone ( boolean $standalone ) : Asset
$standalone boolean
Результат Asset

setType() публичный Метод

public setType ( string $type ) : Asset
$type string
Результат Asset

setVariables() публичный Метод

public setVariables ( array $variables ) : Asset
$variables array
Результат Asset

Описание свойств

$configurationManager защищенное свойство

protected ConfigurationManagerInterface,TYPO3\CMS\Extbase\Configuration $configurationManager
Результат TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface

$content защищенное свойство

protected string $content
Результат string

$dependencies защищенное свойство

protected array $dependencies
Результат array

$external защищенное свойство

protected bool $external
Результат boolean

$fluid защищенное свойство

protected bool $fluid
Результат boolean

$movable защищенное свойство

protected bool $movable
Результат boolean

$name защищенное свойство

protected string $name
Результат string

$namedChunks защищенное свойство

protected bool $namedChunks
Результат boolean

$path защищенное свойство

protected string $path
Результат string

$removed защищенное свойство

protected bool $removed
Результат boolean

$rewrite защищенное свойство

protected bool $rewrite
Результат boolean

$settings защищенное свойство

protected array $settings
Результат array

$standalone защищенное свойство

protected bool $standalone
Результат boolean

$type защищенное свойство

protected string $type
Результат string

$variables защищенное свойство

protected array $variables
Результат array