Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CamelCaseToSeparator.php
Go to the documentation of this file.
1 <?php
25 #require_once 'Zend/Filter/Word/Separator/Abstract.php';
26 
34 {
35 
36  public function filter($value)
37  {
38  if (self::isUnicodeSupportEnabled()) {
39  parent::setMatchPattern(array('#(?<=(?:\p{Lu}))(\p{Lu}\p{Ll})#','#(?<=(?:\p{Ll}|\p{Nd}))(\p{Lu})#'));
40  parent::setReplacement(array($this->_separator . '\1', $this->_separator . '\1'));
41  } else {
42  parent::setMatchPattern(array('#(?<=(?:[A-Z]))([A-Z]+)([A-Z][A-z])#', '#(?<=(?:[a-z0-9]))([A-Z])#'));
43  parent::setReplacement(array('\1' . $this->_separator . '\2', $this->_separator . '\1'));
44  }
45 
46  return parent::filter($value);
47  }
48 
49 }
$value
Definition: gender.phtml:16