mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-25 03:01:21 +08:00
code style
This commit is contained in:
@@ -331,7 +331,7 @@ class BaseInflector
|
|||||||
*/
|
*/
|
||||||
public static function camel2id($name, $separator = '-', $strict = false)
|
public static function camel2id($name, $separator = '-', $strict = false)
|
||||||
{
|
{
|
||||||
$regex = ($strict)?'/[A-Z]/':'/(?<![A-Z])[A-Z]/';
|
$regex = $strict ? '/[A-Z]/' : '/(?<![A-Z])[A-Z]/';
|
||||||
if ($separator === '_') {
|
if ($separator === '_') {
|
||||||
return trim(strtolower(preg_replace($regex, '_\0', $name)), '_');
|
return trim(strtolower(preg_replace($regex, '_\0', $name)), '_');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user