DownloadExtension
extends AbstractExtension
in package
Table of Contents
Properties
- $requestStack : RequestStack
- $twig : Environment
- $utils : Utils
Methods
- __construct() : mixed
- getDownload() : string
- Get download based on given path/uuid.
- getDownloadData() : array<string|int, mixed>|null
- Get download data based on given path/uuid.
- getDownloadLink() : string
- Get download link `?file=` based on given path/uuid.
- getDownloadPath() : string
- Get download path based on given path/uuid.
- getDownloadTitle() : string
- Get download title based on given path/uuid.
- getFilters() : array<string|int, mixed>|array<string|int, Twig_SimpleFilter>
- Get list of twig filters.
Properties
$requestStack
private
RequestStack
$requestStack
$twig
private
Environment
$twig
$utils
private
Utils
$utils
Methods
__construct()
public
__construct(RequestStack $requestStack, Utils $utils, Environment $twig) : mixed
Parameters
- $requestStack : RequestStack
- $utils : Utils
- $twig : Environment
getDownload()
Get download based on given path/uuid.
public
getDownload(mixed $path[, bool $download = true ][, array<string|int, mixed> $data = [] ][, string $template = '@HeimrichHannotContaoUtils/download.html.twig' ]) : string
Parameters
- $path : mixed
-
File path/uuid
- $download : bool = true
-
Return link as download link if true, as download path if false
- $data : array<string|int, mixed> = []
-
Add custom data here
- $template : string = '@HeimrichHannotContaoUtils/download.html.twig'
-
Use custom download template
Tags
Return values
string —Download html element
getDownloadData()
Get download data based on given path/uuid.
public
getDownloadData(mixed $path[, array<string|int, mixed> $data = [] ]) : array<string|int, mixed>|null
Parameters
- $path : mixed
-
File path/uuid
- $data : array<string|int, mixed> = []
-
Add custom data here
Return values
array<string|int, mixed>|null —Download element data
getDownloadLink()
Get download link `?file=` based on given path/uuid.
public
getDownloadLink(mixed $path[, array<string|int, mixed> $data = [] ]) : string
Parameters
- $path : mixed
-
File path/uuid
- $data : array<string|int, mixed> = []
-
Add custom data here
Return values
string —File download link
getDownloadPath()
Get download path based on given path/uuid.
public
getDownloadPath(mixed $path[, array<string|int, mixed> $data = [] ]) : string
Parameters
- $path : mixed
-
File path/uuid
- $data : array<string|int, mixed> = []
-
Add custom data here
Return values
string —File path
getDownloadTitle()
Get download title based on given path/uuid.
public
getDownloadTitle(mixed $path[, array<string|int, mixed> $data = [] ]) : string
Parameters
- $path : mixed
-
File path/uuid
- $data : array<string|int, mixed> = []
-
Add custom data here
Return values
string —Download title
getFilters()
Get list of twig filters.
public
getFilters() : array<string|int, mixed>|array<string|int, Twig_SimpleFilter>