Title
Title - Converts the first letter of each word to uppercase and leaves the others as lowercase.
Title only works with string
, any other type is ignored.
Basic usage
use Jawira\Sanitizer\Filters as Sanitizer;
class Article {
#[Sanitizer\Title]
public string $title;
}
Parameters
No parameters.
Examples
Set value in title case.
use Jawira\Sanitizer\Filters as Sanitizer;
class Article {
#[Sanitizer\Title]
public string $title;
}
"déjà vu" → "Déjà Vu"
"prêt-à-porter" → "Prêt-À-Porter"
"foo bar baz" → "Foo Bar Baz"