CoolCMS API

EditorTextLength
in package

FinalYes

Length of an editor value as the visitor sees it, for upper limits of rich text fields (parameter `max_length`, discussion post text).

With the editor the value is HTML: tags and entities do not count, every run of whitespace (line breaks between paragraphs included) counts as one character. The front counter (char-counter.js, mode text) counts the same way, so the number at the field and the server check agree.

Table of Contents

Methods

visible()  : int

Methods

visible()

public static visible(string $html) : int
Parameters
$html : string
Return values
int
On this page

Search results