Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
opendesktopapp.php
1<?php
2
3declare(strict_types=1);
4
6
8
9final class OpenDesktopApp extends HttpResponse
10{
11 public const DESKTOP_PROTOCOL = 'bx://';
12 private string $url;
13
14 public function __construct(string $url)
15 {
16 $this->url = ltrim($url, '/');
17
18 parent::__construct();
19 }
20
21 protected function buildDesktopUrl(): string
22 {
23 return static::DESKTOP_PROTOCOL . $this->url;
24 }
25
26 public function send(): void
27 {
28 $this->addHeader('Location', $this->buildDesktopUrl());
29 parent::send();
30 }
31}
addHeader($name, $value='')