class DocumentExtension extends Twig_Extension (View source)

Extension that allow render document images.

Methods

__construct(Packages $packages)

DocumentExtension constructor.

string
getName()

No description

array
getFilters()

No description

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

No description

null|string
getImageOrientation(Document $document = null)

Get image orientation.

array|null
getImageSize(Document $document = null)

No description

float|null
getImageRatio(Document $document = null)

No description

null|string
getPath(Document $document = null)

No description

bool
exists(Document $document = null)

No description

Details

__construct(Packages $packages)

DocumentExtension constructor.

Parameters

Packages $packages

string getName()

Return Value

string

array getFilters()

Return Value

array

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

array|null getImageSize(Document $document = null)

Parameters

Document $document

Return Value

array|null

float|null getImageRatio(Document $document = null)

Parameters

Document $document

Return Value

float|null

null|string getPath(Document $document = null)

Parameters

Document $document

Return Value

null|string

bool exists(Document $document = null)

Parameters

Document $document

Return Value

bool