PHP Class FluidTYPO3\Vhs\ViewHelpers\Resource\LanguageViewHelper

Reads a certain language file with returning not just one single label, but all the translated labels. ### Examples
Inheritance: extends TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper, use trait FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait
Show file Open project: fluidtypo3/vhs

Public Methods

Method Description
initializeArguments ( ) : void Registers all arguments for this ViewHelper.
render ( ) : array | string The main render method of this ViewHelper.

Protected Methods

Method Description
getInitializedLanguage ( ) : string Gets the key of current initialized language or fallback to 'default'.
getLabelsByLanguageKey ( array $locallang, string $languageKey ) : array Gets the translated labels by a specific language key or fallback to 'default'.
getLabelsFromTarget ( array $labels ) : array Simplify label array with just taking the value from target.
getLanguageKey ( ) : string Gets the language key from arguments or from current initialized language if argument is not defined.
getResolvedExtensionName ( ) : string Gets the extension name from defined argument or tries to resolve it from the controller context if not set.
getResolvedPath ( ) : string Gets the resolved file path with trying to resolve relative paths even if no extension key is defined.

Method Details

getInitializedLanguage() protected method

Gets the key of current initialized language or fallback to 'default'.
protected getInitializedLanguage ( ) : string
return string

getLabelsByLanguageKey() protected method

Gets the translated labels by a specific language key or fallback to 'default'.
protected getLabelsByLanguageKey ( array $locallang, string $languageKey ) : array
$locallang array
$languageKey string
return array

getLabelsFromTarget() protected method

Simplify label array with just taking the value from target.
protected getLabelsFromTarget ( array $labels ) : array
$labels array
return array

getLanguageKey() protected method

Gets the language key from arguments or from current initialized language if argument is not defined.
protected getLanguageKey ( ) : string
return string

getResolvedExtensionName() protected method

Gets the extension name from defined argument or tries to resolve it from the controller context if not set.
protected getResolvedExtensionName ( ) : string
return string

getResolvedPath() protected method

Gets the resolved file path with trying to resolve relative paths even if no extension key is defined.
protected getResolvedPath ( ) : string
return string

initializeArguments() public method

Registers all arguments for this ViewHelper.
public initializeArguments ( ) : void
return void

render() public method

The main render method of this ViewHelper.
public render ( ) : array | string
return array | string