christianberkman/sortable-book
最新稳定版本:1.0.1
Composer 安装命令:
composer require christianberkman/sortable-book
包简介
Make the title and author sortable for use in a library inventory by moving the article and initials to the end of the string
README 文档
README
Make the title and author sortable for use in a library inventory by moving the article and initials to the end of the string.
This package contains does not contain a class but two helper functions sortableAuthor() and sortableTitle().sw
Installation
Via Composer
composer require chhristianberkman/sortable-book
The file sortable-book.php will be autoloaded.
Manually
require('src/sortable-book.php');
Usage
$author = sortableAuthor('C.S. Lewis'); // Lewis, C.S. $title = sortableTitle('The Last Battle'); // Last Battle, The
Function reference
sortableAuthor(?string $value): ?string
Make a book author sortable by moving initials to the end of the string, preceded by a comma and a space
string $valuestring to format
sortableTitle(?string $value, bool $makeSingleSpaces = true, ?string $articles = 'a|an|the' ): ?string
Make a book title sortable by moving tha article to the end of the string, preceded by a comma and a space.
string $valuestring to formatbool $makeSingleSpacesconvert all whitepaces to a single whitespacestring $articleslist of articles seperated by|, defaults to 'a|an|the'
Returns string or null
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-28