sfMaskedInputPlugin - 0.1.0

Widget which masks an input field by a given alphanumerical mask

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to the Plugins Home


Forgot your password?
Create an account



advanced search
Information Readme Releases Changelog Contribute
Show source



sfMaskedInputPlugin is currently version 0.1.0 Beta. Please contribute to make it better.

sfMaskedInputPlugin contains one widget sfWidgetFormMaskedInput which masks an input field by a given alphanumerical mask.

This sfMaskedInputPlugin makes use of the jQuery plugin 'maskedinput' written by Josh Bush (available at http://digitalbush.com/projects/masked-input-plugin/).

The widget is simple text input using no special stylesheets.


Practically none. This version comes along with jQuery and Maskedinput plugins.


$ symfony plugin:install sfMaskedInputPlugin
$ symfony cache:clear

Plugin Usage

In your form class:

$this->widgetSchema['my_input']= new sfWidgetFormMaskedInput(array('mask' => '99:99', 'placeholder' => '0')),

Plugin Customization

You can configure Widget with following options:

  • mask : set the mask for the input field (Default: 99/99/9999 / date)
    • a - Represents an alpha character (A-Z,a-z)
    • 9 - Represents a numeric character (0-9)
    • * - Represents an alphanumeric character (A-Z,a-z,0-9)
  • placeholder : set the placeholder character for empty places (Default: _ / underscore)


This is a beta release of my (first) symfony plugin. Please comment so I can publish the next version.

When using widget, do not forget to use css and javascript in your form template:

<?php include_javascripts_for_form($your_form) ?>