Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
converter.php
1<?php
2namespace Bitrix\Main\Text;
3
4abstract class Converter
5{
6 const TEXT = "text";
7 const HTML = "html";
8
9 private static $htmlConverter;
10 private static $xmlConverter;
11 private static $emptyConverter;
12
13 public static function getHtmlConverter()
14 {
15 if (self::$htmlConverter == null)
16 self::$htmlConverter = new HtmlConverter();
17 return self::$htmlConverter;
18 }
19
20 public static function getXmlConverter()
21 {
22 if (self::$xmlConverter == null)
23 self::$xmlConverter = new XmlConverter();
24 return self::$xmlConverter;
25 }
26
27 public static function getEmptyConverter()
28 {
29 if (self::$emptyConverter == null)
30 self::$emptyConverter = new EmptyConverter();
31 return self::$emptyConverter;
32 }
33
34 public static function initTextType($textType)
35 {
36 $textType = mb_strtolower($textType);
37 if ($textType != self::TEXT && $textType != self::HTML)
38 $textType = self::TEXT;
39 return $textType;
40 }
41
42 abstract public function encode($text, $textType = "");
43 abstract public function decode($text, $textType = "");
44}
static initTextType($textType)
Definition converter.php:34
encode($text, $textType="")
decode($text, $textType="")