2017 © Pedro Peláez
 

symfony1-plugin dm-char-count-plugin

dmCharCountPlugin - CharCount TextArea for Diem Extended

image

runopencode/dm-char-count-plugin

dmCharCountPlugin - CharCount TextArea for Diem Extended

  • Saturday, November 24, 2012
  • by TheCelavi
  • Repository
  • 2 Watchers
  • 1 Stars
  • 0 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

dmCharCountPlugin 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)

  • To have this field in admin, for your field, add in schema.yml: 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)

Available options for configuration

  • 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:'
))

Importance of configuration:

  1. Constructor
  2. Config for specific form widget by its name
  3. Config for all form widgets

The Versions

24/11 2012

dev-master

9999999-dev http://www.runopencode.com/projects/diem/form-widgets/dmcharcountplugin

dmCharCountPlugin - CharCount TextArea for Diem Extended

  Sources   Download

Free for all

The Requires

 

plugin form form field diem diem extended dmcharcountplugin