dev-master
9999999-dev http://www.runopencode.com/projects/diem/form-widgets/dmcharcountplugindmCharCountPlugin - CharCount TextArea for Diem Extended
Free for all
The Requires
plugin form form field diem diem extended dmcharcountplugin
dmCharCountPlugin - CharCount TextArea for Diem Extended
Author: TheCelavi
Version: 1.0.0
Stability: Stable
Date: November 10th, 2012
Courtesy of Run Open Code
License: Free for all, (*1)
dmCharCountPlugin turns your textarea into char countable field., (*2)
You can use this widget in booth Admin, Front and for your forms:, (*3)
extra: charcount
Example:, (*4)
Testobj: actAs: DmSortable: columns: title: { type: string(255), notnull: true } is_active: { type: boolean, notnull: true, default: false } meta_keywords: { type: string(255), notnull: true } meta_description: { type: string(255), notnull: true, extra: charcount }
In base form of your class the form widget will be used:
new sfWidgetFormDmCharCountTextarea()
., (*5)
You can configure this widget on several different ways, via config.yml
and in
constructor of the class passing the options., (*6)
allowed
, int, default 255, maximum allowed chars.warning
, int or percentage, default is 10%, on which number of chars to warn
about possible exceeding of maximum number of chars. You can enter exact number
of chars when you want for user to be warn.counterText
, string, default is 'Characters left:'. The string is translated
before it is rendered.In config.yml
are default settings for the widget:, (*7)
default: dmCharCountPlugin: all: allowed: 255 warning: 10% counterText: 'Characters left:'
all
is for all form widgets - the default configuration. You can add the name
of the form field for extra configuration options., (*8)
Example for config.yml
:, (*9)
default: dmCharCountPlugin: all: allowed: 255 warning: 10% counterText: 'Characters left:' my_form[my_field]: allowed: 500
Of course, you can pass options into constructor of the widget as well:, (*10)
new sfWidgetFormDmCharCountTextarea(array( 'allowed' => 255, 'warning' => '10%', 'counterText' => 'Characters left:' ))
dmCharCountPlugin - CharCount TextArea for Diem Extended
Free for all
plugin form form field diem diem extended dmcharcountplugin