Admin_View_Helper_Camelize::camelize PHP Метод

camelize() публичный Метод

Camelcase string
public camelize ( string $string, $spacify = true, boolean $lazy = false )
$string string the string to camelize
$lazy boolean wether to make it lazyCamelCase or not
    public function camelize($string, $spacify = true, $lazy = false)
    {
        if ($spacify) {
            $repl = "str_replace('_',' ',strtoupper('\\1'))";
        } else {
            $repl = "strtoupper('\\2')";
        }
        $ret = preg_replace("`(?<=[a-z0-9])(_([a-z0-9]))`e", $repl, $string);
        if ($lazy) {
            return lcfirst($ret);
        } else {
            return ucfirst($ret);
        }
    }
Admin_View_Helper_Camelize