Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
UrlManager.php
1<?php
2
4
7
9{
10 public static function getDownloadUrl(UploaderController $controller, FileInfo $fileInfo): Uri
11 {
12 $uri = self::getActionUrl($controller, 'download');
13 $uri->addParams(['fileId' => $fileInfo->getId()]);
14
15 return $uri;
16 }
17
18 public static function getPreviewUrl(UploaderController $controller, FileInfo $fileInfo): Uri
19 {
20 $uri = self::getActionUrl($controller, 'preview');
21 $uri->addParams(['fileId' => $fileInfo->getId()]);
22
23 return $uri;
24 }
25
26 private static function getActionUrl(UploaderController $controller, string $actionName): Uri
27 {
28 return \Bitrix\Main\Engine\UrlManager::getInstance()->create(
29 "ui.fileuploader.{$actionName}",
30 [
31 'controller' => $controller->getName(),
32 'controllerOptions' => Json::encode($controller->getOptions()),
33 ]
34 );
35 }
36}
static getDownloadUrl(UploaderController $controller, FileInfo $fileInfo)
static getPreviewUrl(UploaderController $controller, FileInfo $fileInfo)