本文整理汇总了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;
}
}