本文整理匯總了PHP中utf8::ucwords方法的典型用法代碼示例。如果您正苦於以下問題:PHP utf8::ucwords方法的具體用法?PHP utf8::ucwords怎麽用?PHP utf8::ucwords使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類utf8
的用法示例。
在下文中一共展示了utf8::ucwords方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: label
public function label($val = NULL)
{
if ($val === NULL) {
// Do not display labels for checkboxes, labels wrap checkboxes
return '';
} else {
$this->data['label'] = $val === TRUE ? utf8::ucwords(inflector::humanize($this->name)) : $val;
return $this;
}
}
示例2: label
/**
* Sets or returns the input label.
*
* @chainable
* @param string label to set
* @return string|object
*/
public function label($val = NULL)
{
if ($val === NULL) {
if (isset($this->data['name']) and isset($this->data['label'])) {
return form::label($this->data['name'], $this->data['label']);
}
return FALSE;
} else {
$this->data['label'] = $val === TRUE ? utf8::ucwords(inflector::humanize($this->name)) : $val;
return $this;
}
}
示例3: title
/**
* Formatted title text
*
* @param string $title
* @param bool $format text
* @return string
*/
public static function title($title, $format = true)
{
return html::specialchars($title);
return html::specialchars($format ? utf8::ucwords(utf8::strtolower($title)) : $title);
}
示例4: label
/**
* Sets or returns the input label.
*
* @chainable
* @param string label to set
* @return string|object
*/
public function label($val = nil)
{
if ($val === nil) {
if (isset($this->data['name']) and isset($this->data['label'])) {
if ($this->has_rule('required')) {
$extra_text .= '<span class="required">*</span>';
}
return form::label($this->data['name'], $this->data['label'] . $extra_text);
}
return NO;
} else {
$this->data['label'] = $val === YES ? utf8::ucwords(inflector::humanize($this->name)) : $val;
return $this;
}
}