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.
sfgWidgetsPlugin provides symfony helpers for the Javascript gWidgets library ("widgets" all based on Prototype and pure css styling), currently including:
gExpander: it is a very simple widget to toggle the visibility of a div. It adds an arrow image before the content (can be customized). It can also load the content in an ajax request if a different url is specified.
gTab: a simple and light tab widget ajax-enabled, accessible and unobtrusive(based on FabTabulous and inspiration from jQuery Tabs plugin).
gBox: overlay a box with the specified inline or remote content, it can be an image or html content (a kind of mixed between lightbox and Thickbox).
gTip: a simple tooltip solution (inspired by jTip)
You can get more details at http://www.estadieu.com/gwidgets/
Alternatively, if you don't have PEAR installed, you can download the latest package attached to this plugin's wiki page and extract it under your project's plugins/ directory.
Usage
You have then 3 possibilities to use gwidgets:
1. use dedicated php helper bundle in this plugin ('gtip', 'gexpander', 'gbox' and 'gwidgets_js', only 'gtab' is not available), they are only useful if you want hyperlink to be the controller,
2. use only html (except the call to 'use_helper'), it's unobtrusive,
3. use standard Symfony helpers such as 'link_to', 'input_tag',... and a few extra options to them.
To pass parameters to gwidgets, you can use global gWidgets_Option objects (gwidgets_js helper) or for local parameters (per widget) you can them in the query string.
If you do not want or cannot use the standard html anchor for inline content (#container), you can them use in the query string a gtip, gexpander or gbox parameter. You can also put an attribute of the html tag to specify parameters and the target container, useful for non link html elements (but not fully xhtml standard...), eg:
.
All examples below use '@route' as the current page symfony route.