sfgWidgetsPlugin - 0.8.0

gWidgets plugin

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

sfgWidgetsPlugin symfony plugin


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/


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.

For gExpander

  1. gexpander helper:

  2. html only: my gexpander

  3. Symfony standard helper: 'gexpander','query_string'=>'#container')) ?>

all of them will show/hide the following:

For gTab:

Your html should be structured like this:

your content here...
content of tab 2 here...

For gBox: the url can be an inline anchor (#container), an image (/images/mybigimage.png) or an external url (myajaxcontent.php).

  1. use 'gbox' helper:

  2. use html only: my gbox

  3. use standard symfony helper:

For gTip:

  1. use 'gtip' helper: '@route','id' => 'container','title' => 'inline tip')) ?>

  2. html only: my tooltip

  1. standard symfony helper: 'gtip', 'title'=>'inline tip','gtip'=>'#container','query_string'=>'?width=400&eventOff=click')) ?> or: 'gtip', 'title'=>'inline tip','query_string'=>'?width=400&eventOff=click#container')) ?>


For the full copyright and license information, please view the LICENSE file that was distributed with this source code.