Beta version

class DocumentExtension extends Twig_Extension

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 = array())

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

at line 52
__construct(Packages $packages)

DocumentExtension constructor.

Parameters

Packages $packages

at line 60
string getName()

Return Value

string

at line 68
array getFilters()

Return Value

array

at line 86
string display(Document $document = null, array $criteria = array())

Parameters

Document $document
array $criteria

Return Value

string

Exceptions

Twig_Error_Runtime

at line 108
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

at line 122
array|null getImageSize(Document $document = null)

Parameters

Document $document

Return Value

array|null

at line 141
float|null getImageRatio(Document $document = null)

Parameters

Document $document

Return Value

float|null

at line 155
null|string getPath(Document $document = null)

Parameters

Document $document

Return Value

null|string

at line 168
bool exists(Document $document = null)

Parameters

Document $document

Return Value

bool