Documentation

TwigExtractor extends AbstractFileExtractor
in package
implements ExtractorInterface

TwigExtractor extracts translation messages from a twig template.

Tags
author

Michel Salib michelsalib@hotmail.com

author

Fabien Potencier fabien@symfony.com

Table of Contents

Interfaces

ExtractorInterface
Extracts translation messages from a directory or files to the catalogue.

Properties

$defaultDomain  : string
Default domain for found messages.
$prefix  : string
Prefix for found message.
$twig  : mixed

Methods

__construct()  : mixed
extract()  : mixed
Extracts translation messages from files, a file or a directory to the catalogue.
setPrefix()  : mixed
Sets the prefix that should be used for new found messages.
canBeExtracted()  : bool
extractFiles()  : iterable<string|int, mixed>
extractFromDirectory()  : iterable<string|int, mixed>
extractTemplate()  : mixed
isFile()  : bool
toSplFileInfo()  : SplFileInfo

Properties

$defaultDomain

Default domain for found messages.

private string $defaultDomain = 'messages'

$prefix

Prefix for found message.

private string $prefix = ''

Methods

extract()

Extracts translation messages from files, a file or a directory to the catalogue.

public extract(mixed $resource, MessageCatalogue $catalogue) : mixed
Parameters
$resource : mixed

Files, a file or a directory

$catalogue : MessageCatalogue

setPrefix()

Sets the prefix that should be used for new found messages.

public setPrefix(string $prefix) : mixed
Parameters
$prefix : string

canBeExtracted()

protected canBeExtracted(string $file) : bool
Parameters
$file : string
Return values
bool

extractFiles()

protected extractFiles(string|iterable<string|int, mixed> $resource) : iterable<string|int, mixed>
Parameters
$resource : string|iterable<string|int, mixed>
Return values
iterable<string|int, mixed>

extractFromDirectory()

protected extractFromDirectory(mixed $directory) : iterable<string|int, mixed>
Parameters
$directory : mixed
Return values
iterable<string|int, mixed>

toSplFileInfo()

private toSplFileInfo(string $file) : SplFileInfo
Parameters
$file : string
Return values
SplFileInfo

        
On this page

Search results