mpStarRatingPlugin - 1.0.0
Use Stars in your rating forms.
You are currently browsing
the website for symfony 1
|Nei Rauni Santos||lead||rb.moc.atnorpalam <<ta>> inuar.ien|
Copyright (c) 2010 Nei Rauni Santos
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
mpWidgetFormChoiceRatingPlugin is a widget created to show radio butons of rating like stars.
This collection starts with only a widget and have external dependencies of jquery.
Install the plugin
$ symfony plugin:install mpWidgetFormChoiceRatingPlugin
Clear the cache
$ symfony cache:clear $ symfony plugin:publish-assets
Use the widget overriting your form widget generated by doctrine or your custom form
$options = array(0 => 'NÃ£o sei', 1 => 'PÃ©ssimo', 2 => 'AceitÃ¡vel', 3 => 'Mediano', 4 => 'Muito bom', 5 => 'Excelente'); $widgets = $this->getWidgetSchema(); $widgets['rating_comfort'] = new mpWidgetFormChoiceRating( array('choices' => $options ) ); $widgets['rating_room'] = new mpWidgetFormChoiceRating( array('choices' => $options ) ); $widgets['rating_service'] = new mpWidgetFormChoiceRating( array('choices' => $options ) );
make sure you already have the jquery js in the page, so download the ui files from jquery website and put in web/jquery/jquery.ui/ui/ui.core.js web/jquery/jquery.ui/ui/jquery.ui.widget.js
that's all folks.
All classes have full API and usage documentation. The best way to learn each widget or validator is to read the API.
As no third party libraries is bundled in the plugin, you need to install and load the required dependencies like JQuery and JQuery UI.
It's based on Star Rating widget ( http://plugins.jquery.com/project/Star_Rating_widget )