1 | <?php |
||
18 | class Slug extends FilterRule |
||
19 | { |
||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $fieldToSlugFrom; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $transliterator = "Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower();"; |
||
29 | |||
30 | /** |
||
31 | * @param string $fieldToSlugFrom |
||
32 | */ |
||
33 | 7 | public function __construct($fieldToSlugFrom) |
|
37 | |||
38 | /** |
||
39 | * Slug the value of either the actual field of the given one. |
||
40 | * |
||
41 | * @param mixed $value |
||
42 | * @return string |
||
43 | */ |
||
44 | 7 | public function filter($value) |
|
56 | } |
||
57 |