定制 spartz/text-formatter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

spartz/text-formatter

最新稳定版本:1.0.1

Composer 安装命令:

composer require spartz/text-formatter

包简介

A simple to use text formatter, primarily used for page/blog titles

README 文档

README

Build Status Code Coverage Code Quality Code Climate Latest Version Software License

Title Text Formatter

A simple to use text formatter, primarily used for page/blog titles.

Install

Via Composer

"require": {
    "spartz/text-formatter": "~1.0"
}

Usage

use Spartz\TextFormatter\TextFormatter;

$title = "this is a messy title. [can you fix it?]";
$title = TextFormatter::titleCase($title);
echo $title; // This is a Messy Title. [Can You Fix It?]

Formatting "Rules"

  1. First word in a sentence is capitalized
  2. Last word in a sentence is capitalized
  3. Words within brackets (or similar) are capitalized, similar to rules #1 & #2
  4. Words within the $ignoredWords array should not be capitalized as long as it doesn't conflict with rules #1-#3
  5. Words preceded by multiple special characters should be capitalized: $$$Money
  6. All dashed words should be capitalized: Super-Awesome-Post
  7. 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

If you discover any security related issues, please email Chris Gmyr instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 5.84k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 8
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-23