1 | <?php |
||
11 | class Translug |
||
12 | { |
||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $config = []; |
||
17 | |||
18 | /** |
||
19 | * Translug constructor. |
||
20 | * |
||
21 | * @param array $config |
||
22 | */ |
||
23 | 5 | public function __construct(array $config = []) |
|
27 | |||
28 | /** |
||
29 | * @param array $config |
||
30 | */ |
||
31 | 1 | public function setConfig(array $config) |
|
35 | |||
36 | 1 | public function getConfig() |
|
40 | |||
41 | /** |
||
42 | * @param $text |
||
43 | * @return mixed |
||
44 | */ |
||
45 | 2 | public function translate($text) |
|
51 | |||
52 | /** |
||
53 | * @param $text |
||
54 | * @return string |
||
55 | */ |
||
56 | 1 | public function translug($text) |
|
60 | |||
61 | /** |
||
62 | * @param $title |
||
63 | * @param string $separator |
||
64 | * @return string |
||
65 | */ |
||
66 | 1 | private function sluggable($title, $separator = '-') |
|
78 | } |