1 | <?php |
||
10 | class Translug |
||
11 | { |
||
12 | /** |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $config = []; |
||
16 | |||
17 | /** |
||
18 | * Translug constructor. |
||
19 | * |
||
20 | * @param array $config |
||
21 | */ |
||
22 | public function __construct(array $config = []) |
||
26 | |||
27 | /** |
||
28 | * @param array $config |
||
29 | */ |
||
30 | public function setConfig(array $config) |
||
34 | |||
35 | /** |
||
36 | * @return array |
||
37 | */ |
||
38 | public function getConfig() |
||
42 | |||
43 | /** |
||
44 | * @param $text |
||
45 | * |
||
46 | * @return mixed |
||
47 | */ |
||
48 | public function translate($text) |
||
54 | |||
55 | /** |
||
56 | * @param $text |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | public function translug($text) |
||
64 | |||
65 | /** |
||
66 | * @param $title |
||
67 | * @param string $separator |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | private function sluggable($title, $separator = '-') |
||
83 | } |
||
84 |