2017 © Pedro Peláez
 

library text-formatter

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

image

spartz/text-formatter

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

  • Monday, November 2, 2015
  • by cmgmyr
  • Repository
  • 11 Watchers
  • 0 Stars
  • 5,789 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Build Status Code Coverage Code Quality Code Climate Latest Version Software License, (*1)

Title Text Formatter

A simple to use text formatter, primarily used for page/blog titles., (*2)

Install

Via Composer, (*3)

"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., (*4)

Security

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

Credits

License

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

The Versions

02/11 2015

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

02/11 2015

1.0.1

1.0.1.0

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

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires

27/04 2015

1.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

The Development Requires