MOvEJQueryUIPlugin
1.0.3stable
for sf 1.4sf 1.3 MIT
This plugin provides widgets and helpers so you can easily integrate jQueryUI into your symfony project. Currently only one widget is available, MOvEWidgetFormDateJQueryUI which uses jQuery DatePicker to choose a date.
Developers
| Name |
Status |
Email |
Daan Debie |
lead |
ln.evom <<ta>> naad
|
License
Copyright (c) 2011 Daan Debie - daan(at)move.nl
This plugin is based on the sfJQueryUIPlugin by Artur Rozek. Therefore the same
licence is used as with the original iteration:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MOvEJQueryUIPlugin
Description
This plugin makes use of jQuery UI library.
This plugin provides widgets and helpers so you can easily integrate jQueryUI into your symfony project.
Currently only one widget is available, MOvEWidgetFormDateJQueryUI which uses jQuery DatePicker to choose a date.
The Widget displays one input tag (not three seperated input tags for year, month and day like the jQueryUI datepicker Widget in sfFormExtraPlugin).
This plugin uses the jQuery library - so its not compatible with sfProtoculousPlugin (which has to be disabled).
Depedencies
This Plugin requires the jquery library itself, which is included in the plugin, and can be inserted with the getJavaScripts() method.
Also included are the stylesheets of all the standard UI themes. Insert with getStyleSheets().
Installation
$ symfony plugin:install MOvEJQueryUIPlugin
$ symfony cache:clear
If you're installing from the archive, do not forget to copy the contents of the Plugin's web directory to your project's web directory, either by hand or with:
$ symfony plugin:publish-assets
sfWidgetFormDateJQueryUI Usage
In your form class:
$this->widgetSchema['my_date']= new MOvEWidgetFormDateJQueryUI(array("change_month" => true, "change_year" => true)),
sfWidgetFormDateJQueryUI Customization
Yuo can configure Widget with following options:
- culture : Configure culture for the widget, defaults to sfContext::getInstance()->getUser()->getCulture()
- change_month : If datepicker attached to widget has month dropdown, defaults to false
- change_year : If datepicker attached to widget has year dropdown, defaults to false
- number_of_months : Number of months visible in datepicker, defaults to 1
- show_button_panel : If datepicker shows panel with 'today' and 'done' buttons, defaults to false
- theme : Css theme for jquery ui interface, can be either the name of a standard jQueryUI theme (which are all included), or the path to a custom theme, you can make here. Defaults to 'ui-lightness'
- altField : ID of a second formfield that will get populated with the picked date.
- dateFormat : Format in which the date will be displayed. See jQueryUI documentation for options.
- defaultDate : Sets defaultDate. This uses the $value param from the render method, if option is not set.
Notes
Widget is simple text input tag, date chooser appears after input is focused/clicked. User can still input date by hand. I recommend to use date validator.
When using widget, do not forget to use css and javascript in your form template:
<?php use_stylesheets_for_form($your_form) ?>
<?php use_javascripts_for_form($your_form) ?>