You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
16
extend/app_alipay/lotusphp_runtime/Inflector/Inflector.php
Executable file
16
extend/app_alipay/lotusphp_runtime/Inflector/Inflector.php
Executable file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
class LtInflector
|
||||
{
|
||||
public $conf = array("separator" => "_");
|
||||
|
||||
public function camelize($uncamelized_words)
|
||||
{
|
||||
$uncamelized_words = $this->conf["separator"] . str_replace($this->conf["separator"] , " ", strtolower($uncamelized_words));
|
||||
return ltrim(str_replace(" ", "", ucwords($uncamelized_words)), $this->conf["separator"] );
|
||||
}
|
||||
|
||||
public function uncamelize($camelCaps)
|
||||
{
|
||||
return strtolower(preg_replace('/([a-z])([A-Z])/', "$1" . $this->conf["separator"] . "$2", $camelCaps));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user