PHP Class FluidTYPO3\Vhs\ViewHelpers\Asset\AbstractAssetViewHelper

Note: building of all Assets takes place in the class FluidTYPO3\Vhs\Service\AssetService with two reasons: - A "buildAll" method should never be possible to call from any Asset ViewHelper; it should only be possible from a single class. - The method but must be public and non-static and thus cannot be hidden from access by subclasses if placed in this class.
Inheritance: extends TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper, implements FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface, use trait FluidTYPO3\Vhs\Traits\ArrayConsumingViewHelperTrait
显示文件 Open project: fluidtypo3/vhs Class Usage Examples

Protected Properties

Property Type Description
$assetService FluidTYPO3\Vhs\Service\AssetService
$configurationManager TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
$content string
$localSettings array
$objectManager TYPO3\CMS\Extbase\Object\ObjectManagerInterface
$tagBuilder TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder
$type string If a LESS stylesheet is being compiled the "type" would be "css" because this will group the compiled LESS stylesheet with other CSS - allowing it to be merged with other CSS.

Public Methods

Method Description
__toString ( ) : string
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:
getAssetSettings ( ) : array
getDebugInformation ( ) : array Allows public access to debug this particular Asset instance later, when including the Asset in the page.
getDependencies ( ) : array
getGroup ( ) : string
getName ( ) : string
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.
getType ( ) : string
getVariables ( ) : array
initializeArguments ( ) : void
injectAssetService ( AssetService $assetService ) : void
injectConfigurationManager ( TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager ) : void
injectObjectManager ( TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager ) : void
render ( ) : void Render method
setSettings ( array | ArrayAccess $settings )

Protected Methods

Method Description
debug ( ) : mixed
finalize ( ) : void Saves this Asset or perhaps discards it if overriding is disabled and an identically named Asset already exists.
getContent ( ) : string
getOverwrite ( ) : boolean
getTagWithContent ( ) : string

Method Details

__toString() public method

public __toString ( ) : string
return string

assertAddNameCommentWithChunk() public method

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() public method

public assertAllowedInFooter ( ) : boolean
return boolean

assertDebugEnabled() public method

Returns TRUE if the current Asset should be debugged as commanded by settings in TypoScript an/ord ViewHelper attributes.
public assertDebugEnabled ( ) : boolean
return boolean

assertFluidEnabled() public method

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
return boolean

assertHasBeenRemoved() public method

public assertHasBeenRemoved ( ) : boolean
return boolean

build() public method

- 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
return mixed

debug() protected method

protected debug ( ) : mixed
return mixed

finalize() protected method

Performed from every Asset's render() for it to work.
protected finalize ( ) : void
return void

getAssetSettings() public method

public getAssetSettings ( ) : array
return array

getContent() protected method

protected getContent ( ) : string
return string

getDebugInformation() public method

Allows public access to debug this particular Asset instance later, when including the Asset in the page.
public getDebugInformation ( ) : array
return array

getDependencies() public method

public getDependencies ( ) : array
return array

getGroup() public method

public getGroup ( ) : string
return string

getName() public method

public getName ( ) : string
return string

getOverwrite() protected method

protected getOverwrite ( ) : boolean
return boolean

getSettings() public method

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
return array

getTagWithContent() protected method

protected getTagWithContent ( ) : string
return string

getType() public method

public getType ( ) : string
return string

getVariables() public method

public getVariables ( ) : array
return array

initializeArguments() public method

public initializeArguments ( ) : void
return void

injectAssetService() public method

public injectAssetService ( AssetService $assetService ) : void
$assetService FluidTYPO3\Vhs\Service\AssetService
return void

injectConfigurationManager() public method

public injectConfigurationManager ( TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager ) : void
$configurationManager TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
return void

injectObjectManager() public method

public injectObjectManager ( TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager ) : void
$objectManager TYPO3\CMS\Extbase\Object\ObjectManagerInterface
return void

render() public method

Render method
public render ( ) : void
return void

setSettings() public method

public setSettings ( array | ArrayAccess $settings )
$settings array | ArrayAccess

Property Details

$assetService protected_oe property

protected AssetService,FluidTYPO3\Vhs\Service $assetService
return FluidTYPO3\Vhs\Service\AssetService

$configurationManager protected_oe property

protected ConfigurationManagerInterface,TYPO3\CMS\Extbase\Configuration $configurationManager
return TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface

$content protected_oe property

protected string $content
return string

$localSettings protected_oe property

protected array $localSettings
return array

$objectManager protected_oe property

protected ObjectManagerInterface,TYPO3\CMS\Extbase\Object $objectManager
return TYPO3\CMS\Extbase\Object\ObjectManagerInterface

$tagBuilder protected_oe property

protected TagBuilder,TYPO3\CMS\Fluid\Core\ViewHelper $tagBuilder
return TYPO3\CMS\Fluid\Core\ViewHelper\TagBuilder

$type protected_oe property

If a LESS stylesheet is being compiled the "type" would be "css" because this will group the compiled LESS stylesheet with other CSS - allowing it to be merged with other CSS.
protected string $type
return string