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 | 4 | public function __construct(array $config = []) |
|
27 | |||
28 | /** |
||
29 | * @param array $config |
||
30 | */ |
||
31 | public function setConfig(array $config) |
||
35 | |||
36 | /** |
||
37 | * @param $text |
||
38 | * @return mixed |
||
39 | */ |
||
40 | 2 | public function translate($text) |
|
46 | |||
47 | /** |
||
48 | * @param $text |
||
49 | * @return string |
||
50 | */ |
||
51 | 1 | public function translug($text) |
|
55 | |||
56 | /** |
||
57 | * @param $title |
||
58 | * @param string $separator |
||
59 | * @return string |
||
60 | */ |
||
61 | 1 | private function sluggable($title, $separator = '-') |
|
73 | } |