Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
openmobileapp.php
1<?php
2
3declare(strict_types=1);
4
6
8
9final class OpenMobileApp extends HttpResponse
10{
11 public const MOBILE_PROTOCOL = 'bitrix24://';
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 buildMobileUrl(): string
22 {
23 return static::MOBILE_PROTOCOL . $this->url;
24 }
25
26 public function send(): void
27 {
28 $this->addHeader('Location', $this->buildMobileUrl());
29 parent::send();
30 }
31}
addHeader($name, $value='')