protected function HandlerBase::caseTransform in Views (for Drupal 7) 8.3
Transform a string by a certain method.
Parameters
$string: The input you want to transform.
$option: How do you want to transform it, possible values:
- upper: Uppercase the string.
- lower: lowercase the string.
- ucfirst: Make the first char uppercase.
- ucwords: Make each word in the string uppercase.
Return value
string The transformed string.
5 calls to HandlerBase::caseTransform()
- FieldPluginBase::render_as_link in lib/
Drupal/ views/ Plugin/ views/ field/ FieldPluginBase.php - Render this field as a link, with the info from a fieldset set by the user.
- ListString::summary_name in lib/
Views/ field/ Plugin/ views/ argument/ ListString.php - Provides the name to use for the summary. By default this is just the name field.
- String::summary_argument in lib/
Drupal/ views/ Plugin/ views/ argument/ String.php - Provide the argument to use to link from the summary to the next level; this will be called once per row of a summary, and used as part of $view->getUrl().
- String::summary_name in lib/
Drupal/ views/ Plugin/ views/ argument/ String.php - Provides the name to use for the summary. By default this is just the name field.
- String::title in lib/
Drupal/ views/ Plugin/ views/ argument/ String.php - Get the title this argument will assign the view, given the argument.
File
- lib/
Drupal/ views/ Plugin/ views/ HandlerBase.php, line 250 - Definition of Drupal\views\Plugin\views\HandlerBase.
Class
Namespace
Drupal\views\Plugin\viewsCode
protected function caseTransform($string, $option) {
global $multibyte;
switch ($option) {
default:
return $string;
case 'upper':
return drupal_strtoupper($string);
case 'lower':
return drupal_strtolower($string);
case 'ucfirst':
return drupal_strtoupper(drupal_substr($string, 0, 1)) . drupal_substr($string, 1);
case 'ucwords':
if ($multibyte == UNICODE_MULTIBYTE) {
return mb_convert_case($string, MB_CASE_TITLE);
}
else {
return ucwords($string);
}
}
}