sfgWidgetsPlugin - 0.8.0
You are currently browsing
the website for symfony 1
This plugin is not maintained anymore and it is outdated. You can find all those features in jQuery plugins or Prototype.
|Gerald Estadieu||lead||moc.liamg <<ta>> ueidatseg|
Copyright (c) 2007 Gerald Estadieu
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.
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/
symfony plugin-install http://plugins.symfony-project.com/sfgWidgetsPlugin
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.
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.
html only: my gexpander
Symfony standard helper: 'gexpander','query_string'=>'#container')) ?>
all of them will show/hide the following:
Your html should be structured like this:
For gBox: the url can be an inline anchor (#container), an image (/images/mybigimage.png) or an external url (myajaxcontent.php).
use 'gbox' helper:
use html only: my gbox
use standard symfony helper:
use 'gtip' helper: '@route','id' => 'container','title' => 'inline tip')) ?>
html only: my tooltip
For the full copyright and license information, please view the LICENSE file that was distributed with this source code.