Download the PHP package jlorente/yii2-widget-remainingcharacters without Composer
On this page you can find all versions of the php package jlorente/yii2-widget-remainingcharacters. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jlorente/yii2-widget-remainingcharacters
More information about jlorente/yii2-widget-remainingcharacters
Files in jlorente/yii2-widget-remainingcharacters
Package yii2-widget-remainingcharacters
Short Description Widget to add a remaining character counter to text inputs and textareas
License MIT
Homepage https://github.com/jlorente/yii2-widget-remainingcharacters
Informations about the package yii2-widget-remainingcharacters
Yii2 Remaining Characters Widget
RemainingCharacters widget is a Yii2 wrapper for the jquery-remaining-characters jQuery plugin Remaining Characters jQuery plugin. This input widget is a replacement for text and textarea inputs. It appends a container with a countdown counter of characters to the input.
Installation
The preferred way to install this extension is through composer. Check the composer.json for this extension's requirements and dependencies.
To install, either run
or add
to the section of your composer.json
file.
Usage
Where options array are the options for the textarea.
Options
Option | Type | Default | Description |
---|---|---|---|
type | string | RemainingCharacters::INPUT_TEXTAREA | Type of the input. Must be RemainingCharacters::INPUT_TEXTAREA or RemainingCharacters::INPUT_TEXT |
text | string | '{n}' | Text to display inside the label where {n} is the placeholder of the remaining characters counter. i.e.: '{n} characters remaining' |
label | array | Options related to the label container | |
label.tag | string | 'p' | Html tag of the label |
label.id | string | null | Id of the label |
label.class | string | 'char-counter' | Class of the label |
label.invalidClass | string | 'error' | Class to add to the label if the counter reaches an invalid number |
options | array | Options for the input text or textarea. See ActiveField::textarea() or ActiveField::textInput() for more information |
License
Copyright © 2015 José Lorente Martín. Licensed under the MIT license. See LICENSE.txt for details.