class DocumentExtension extends Twig_Extension (View source)

Extension that allow render document images.

Methods

__construct(Container $container, bool $throwExceptions = false)

DocumentExtension constructor.

string
getName()

No description

array
getFilters()

No description

getEmbedFinder(Document $document = null)

No description

string
display(Document $document = null, array $criteria = [])

No description

null|string
getImageOrientation(Document $document = null)

Get image orientation.

array
getImageSize(Document $document = null)

No description

float
getImageRatio(Document $document = null)

No description

null|string
getPath(Document $document = null)

No description

bool
exists(Document $document = null)

No description

Details

__construct(Container $container, bool $throwExceptions = false)

DocumentExtension constructor.

Parameters

Container $container
bool $throwExceptions Trigger exception if using filter on NULL values (default: false)

string getName()

Return Value

string

array getFilters()

Return Value

array

bool|AbstractEmbedFinder getEmbedFinder(Document $document = null)

Parameters

Document $document

Return Value

bool|AbstractEmbedFinder

Exceptions

Twig_Error_Runtime

string display(Document $document = null, array $criteria = [])

Parameters

Document $document
array $criteria

Return Value

string

Exceptions

Twig_Error_Runtime

null|string getImageOrientation(Document $document = null)

Get image orientation.

  • Return null if document is not an Image
  • Return 'landscape' if width is higher or equal to height
  • Return 'portrait' if height is strictly lower to width

Parameters

Document $document

Return Value

null|string

Exceptions

Twig_Error_Runtime

array getImageSize(Document $document = null)

Parameters

Document $document

Return Value

array

Exceptions

Twig_Error_Runtime

float getImageRatio(Document $document = null)

Parameters

Document $document

Return Value

float

Exceptions

Twig_Error_Runtime

null|string getPath(Document $document = null)

Parameters

Document $document

Return Value

null|string

bool exists(Document $document = null)

Parameters

Document $document

Return Value

bool