TranslateViewHelper
class TranslateViewHelper extends AbstractViewHelper (View source)
Returns translated message using source message or key ID.
Also replaces all placeholders with formatted versions of provided values.
= Examples =
{f:translate(id: 'some.label.id', value: 'fallback result')}
```
```
```
```
Untranslated label
```
Properties
protected RenderingContextInterface | $renderingContext | from AbstractViewHelper | |
protected ControllerContext | $controllerContext | Controller Context to use |
from AbstractViewHelper |
protected ObjectManagerInterface | $objectManager | from AbstractViewHelper | |
protected LoggerInterface | $logger | from AbstractViewHelper | |
protected Translator | $translator |
Methods
void
setRenderingContext(RenderingContextInterface $renderingContext)
No description
from
AbstractViewHelper
void
from
AbstractViewHelper
void
injectLogger(LoggerInterface $logger)
Injects the (system) logger based on PSR-3.
from
AbstractViewHelper
void
initializeArguments()
Initialize arguments
string
render()
Renders the translated label.
Details
void
setRenderingContext(RenderingContextInterface $renderingContext)
No description
void
injectObjectManager(ObjectManagerInterface $objectManager)
No description
void
injectLogger(LoggerInterface $logger)
Injects the (system) logger based on PSR-3.
bool
isEscapingInterceptorEnabled()
No description
void
initializeArguments()
Initialize arguments
string
render()
Renders the translated label.
Replaces all placeholders with corresponding values if they exist in the translated label.
injectTranslator(Translator $translator)
No description