This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Sequenzia/lib/Rails/ActionView/Helper/Methods/Inflections.php
2013-10-02 11:14:53 -05:00

55 lines
1.3 KiB
PHP
Executable File

<?php
namespace Rails\ActionView\Helper\Methods;
trait Inflections
{
public function pluralize($word, $locale = 'en')
{
return $this->inflector()->pluralize($word, $locale);
}
public function singularize($word, $locale = 'en')
{
return $this->inflector()->singularize($word, $locale);
}
public function camelize($term, $uppercaseFirstLetter = true)
{
return $this->inflector()->camelize($term, $uppercaseFirstLetter);
}
public function underscore($camelCasedWord)
{
return $this->inflector()->underscore($camelCasedWord);
}
public function humanize($lowerCaseAndUnderscoredWord)
{
return $this->inflector()->humanize($lowerCaseAndUnderscoredWord);
}
public function titleize($word)
{
return $this->inflector()->titleize($word);
}
public function tableize($className)
{
return $this->inflector()->tableize($className);
}
public function classify($tableName)
{
return $this->inflector()->classify($tableName);
}
public function ordinal($number)
{
return $this->inflector()->ordinal($number);
}
public function inflector()
{
return \Rails::services()->get('inflector');
}
}