Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzhhui authored Jun 14, 2018
1 parent 41272f5 commit cc83264
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Helper/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ public static function ascii($value)
* Convert a value to camel case.
*
* @param string $value
* @param bool $lcfirst
* @return string
*/
public static function camel($value)
public static function camel($value, $lcfirst = true)
{
if (isset(static::$camelCache[$value])) {
return static::$camelCache[$value];
}

return static::$camelCache[$value] = lcfirst(static::studly($value));
return static::$camelCache[$value] = ($lcfirst ? lcfirst(static::studly($value)) : static::studly($value));
}

/**
Expand Down

0 comments on commit cc83264

Please sign in to comment.