Download the PHP package code-atlantic/chophper without Composer
On this page you can find all versions of the php package code-atlantic/chophper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download code-atlantic/chophper
More information about code-atlantic/chophper
Files in code-atlantic/chophper
Download code-atlantic/chophper
More information about code-atlantic/chophper
Files in code-atlantic/chophper
Vendor code-atlantic
Package chophper
Short Description HTML text truncation library for PHP
License MIT
Package chophper
Short Description HTML text truncation library for PHP
License MIT
Please rate this library. Is it a good library?
Informations about the package chophper
Chophper - A simple text truncation utility for HTML
Chophper is a PHP utility for truncating text within HTML to a given length without breaking the HTML tags.
Support for:
- Truncate chars, optionally respecting word boundaries
- Truncate words, optionally respecting sentence boundaries
- Truncate sentences, optionally respecting block boundaries
- Truncate blocks (paragraphs, lists, etc.)
- Preserving HTML tags
- Preserving HTML entities
Note: This is an alpha version. Use at your own risk, and expect API changes towards simple and more flexible usage before the first stable release.
Installation
Install via composer:
Usage
Options ( current, very subject to change )
Option | Type | Default | Description |
---|---|---|---|
ellipsis |
string | … |
The string to append to the truncated text. |
truncateBy |
string | words |
Whether to break the text by chars, words, sentences or blocks |
preserveWords |
boolean | false |
Whether to preserve words when using chars truncation. |
Options (wisthlist)
Option | Type | Default | Description |
---|---|---|---|
wordBreak |
boolean | false |
Whether to break the text at word boundaries. |
preserveTags |
boolean | false |
Whether to preserve HTML tags. |
tagsWhitelist |
array | [] |
A list of HTML tags to preserve. |
tagsBlacklist |
array | [] |
A list of HTML tags to remove. |
tagsIngoreLength |
array | [] |
A list of HTML tags to not count towards the length. |
preserveEntities |
boolean | false |
Whether to preserve HTML entities. |
entitiesWhitelist |
array | [] |
A list of HTML entities to preserve. |
entitiesBlacklist |
array | [] |
A list of HTML entities to remove. |
preserveImages |
boolean | false |
Whether to preserve images. |
All versions of chophper with dependencies
PHP Build Version
Package Version
Requires
masterminds/html5 Version
^2.8.1
The package code-atlantic/chophper contains the following files
Loading the files please wait ....