ericmakesstuff/display-name
最新稳定版本:1.0.1
Composer 安装命令:
composer require ericmakesstuff/display-name
包简介
A simple package to show user's real names in a variety of Web-safe ways, i.e. Eric B. or E B. Also includes a Laravel Facade.
README 文档
README
A simple package to show user's real names in a variety of Web-safe ways, i.e. Eric B. or E B. Also includes a Laravel Facade.
Install
Via Composer
$ composer require ericmakesstuff/display-name
Usage
$displayName = new EricMakesStuff\DisplayName\DisplayName(); echo $displayName->fullName('John Smith'); // John Smith echo $displayName->firstName('John Smith'); // John echo $displayName->firstNameLastInitial('John Smith'); // John S echo $displayName->firstNameLastInitialWithPeriod('John Smith'); // John S. echo $displayName->initials('John Smith'); // JS echo $displayName->initialsWithPeriods('John Smith'); // J.S. echo $displayName->initialsWithSpaces('John Smith'); // J S echo $displayName->format('John Smith', 'initials'); // JS
Laravel Facade
Include the Service Provider in config/app.php
'EricMakesStuff\DisplayName\DisplayNameServiceProvider',
Include the Facade in config/app.php
'DisplayName' => 'EricMakesStuff\DisplayName\Facades\DisplayName',
Use the facade
DisplayName::firstName('John Smith') // John DisplayName::format('John Smith', 'initials') // JS
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email eric at ericmakesstuff dot com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 652
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-17