lithium\util\Inflector::underscore()

public static method

Takes a CamelCased version of a word and turns it into an under_scored one.

Parameters

  • string $word

    CamelCased version of a word (i.e. 'RedBike').

Returns

string

Under_scored version of the workd (i.e. 'red_bike').

Source

	public static function underscore($word) {
		if (isset(static::$_underscored[$word])) {
			return static::$_underscored[$word];
		}
		return static::$_underscored[$word] = strtolower(static::slug($word, '_'));
	}