Return to Snippet

Revision: 15601
at July 11, 2009 09:52 by iloveitaly


Initial Code
<?
class inflector extends inflector_Core {
	public static function titlize($rawTitle) {
		if(strlen($rawTitle) < 3) {
			return strtoupper($rawTitle);
		} else {
			return ucwords(self::humanize($rawTitle));
		}
	}
}

echo inflector::titlize("news_items"); // News Items
echo inflector::titlize("id"); // ID
?>

Initial URL

                                

Initial Description

                                

Initial Title
Convert Database/Variable Name to Human Title

Initial Tags
database, function

Initial Language
PHP