定制 christianberkman/sortable-book 二次开发

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

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

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 $value string 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 $value string to format
  • bool $makeSingleSpaces convert all whitepaces to a single whitespace
  • string $articles list of articles seperated by |, defaults to 'a|an|the'

Returns string or null

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-28