cmgmyr/title-formatter
Composer 安装命令:
composer require cmgmyr/title-formatter
包简介
A simple to use text formatter, primarily used for page/blog titles
README 文档
README
Title Text Formatter
A simple to use text formatter, primarily used for page/blog titles.
Install
Via Composer
"require": {
"cmgmyr/title-formatter": "~3.0"
}
Usage
use Cmgmyr\TitleFormatter\TitleFormatter; $title = "this is a messy title. [can you fix it?]"; $title = TitleFormatter::titleCase($title); echo $title; // This is a Messy Title. [Can You Fix It?]
Formatting "Rules"
- First word in a sentence is capitalized
- Last word in a sentence is capitalized
- Words within brackets (or similar) are capitalized, similar to rules #1 & #2
- Words within the
$ignoredWordsarray should not be capitalized as long as it doesn't conflict with rules #1-#3 - Words preceded by multiple special characters should be capitalized: $$$Money
- All dashed words should be capitalized: Super-Awesome-Post
- Ignore words that already include at least one uppercase letter. We'll assume that the author knows what they're doing: eBay, iPad, McCormick, etc
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
统计信息
- 总下载量: 591
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-24