Beta version

class DocumentViewer implements ViewableInterface

Class DocumentViewer

Methods

getDocument()

No description

__construct(Document $document)

No description

Translator.
getTranslator()

No description

Twig_Environment
getTwig()

No description

string
getDocumentByArray(array $options = array())

Output a document HTML tag according to its Mime type and the arguments array.

bool
isEmbedPlatformSupported()

No description

getEmbedFinder()

No description

string
getDocumentUrlByArray(array $options = array(), boolean $absolute = false)

Generate a resampled document Url.

Details

at line 52
Document getDocument()

Return Value

Document

at line 60
__construct(Document $document)

Parameters

Document $document

at line 68
Translator. getTranslator()

Return Value

Translator.

at line 76
Twig_Environment getTwig()

Return Value

Twig_Environment

at line 167
string getDocumentByArray(array $options = array())

Output a document HTML tag according to its Mime type and the arguments array.

HTML output options

  • embed (true|false), display an embed as iframe instead of its thumbnail
  • identifier
  • class
  • alt: If not filled, it will get the document name, then the document filename

Images resampling options

  • width
  • height
  • lazyload (true | false) set src in data-src
  • crop ({w}x{h}, for example : 100x200)
  • fit ({w}x{h}, for example : 100x200)
  • rotate (1-359 degrees, for example : 90)
  • grayscale (boolean)
  • quality (1-100)
  • blur (1-100)
  • sharpen (1-100)
  • contrast (1-100)
  • background (hexadecimal color without #)
  • progressive (boolean)
  • noProcess (boolean) : Disable image resample
  • inline : For SVG, display SVG code in Html instead of using
  • srcset : Array [ - format: Array (same options as image) - rule ]
  • sizes : Array [ - "size1" - "size2" ]
  • Audio / Video options

    • autoplay
    • loop
    • controls
    • custom_poster

    For videos, a poster can be set if you name a document after your video filename (without extension).

    Parameters

    array $options

    Return Value

    string HTML output

    at line 258
    bool isEmbedPlatformSupported()

    Return Value

    bool

    at line 277
    bool|AbstractEmbedFinder getEmbedFinder()

    Return Value

    bool|AbstractEmbedFinder

    at line 419
    string getDocumentUrlByArray(array $options = array(), boolean $absolute = false)

    Generate a resampled document Url.

    Generated URL will be absolute and static if a static domain name has been setup.

    • width
    • height
    • crop ({w}x{h}, for example : 100x200)
    • fit ({w}x{h}, for example : 100x200)
    • rotate (1-359 degrees, for example : 90)
    • grayscale (boolean)
    • quality (1-100) - default: 90
    • blur (1-100)
    • sharpen (1-100)
    • contrast (1-100)
    • background (hexadecimal color without #)
    • progressive (boolean)
    • noProcess (boolean) : Disable image resample

    Parameters

    array $options
    boolean $absolute

    Return Value

    string Url