trSimpleTipPlugin - 1.0.0

Helper that integrate SimpleTip jQuery 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


The trSimpleTipPlugin offers a helper that integrate the SimpleTip jQuery Plugin.


  • Install the plugin (via a package)

    symfony plugin:install trSimpleTipPlugin
  • Install the plugin (via a Subversion checkout)

    svn co

This plugin requires sfJqueryReloadedPlugin, only if you haven't already included the jQuery Javascript framework inside your project.


Make sure you have included the SimpleTip helper inside your template file:


or, if you have installed the sfJqueryReloadedPlugin, use:

use_helper('jQuery', 'SimpleTip');

Example 1

For the following HTML code:

Some test <a href="#" title="Some simple tip info" alt="Some simple tip info">Test link</a>

We can use the following call:

<?php simpletip('a[title]') ?>

This will initialize the SimpleTip jQuery Plugin for all anchors inside the HTML document, that have a valid title tag. The actual JS code will be:

<script type="text/javascript">
  $('a[title]').each(function() {
    var options = {
    options['content'] = $(this).attr('title');
    $(this).attr('title', '');
    $(this).attr('alt', '');

Example 2

For the following HTML code:

Another example <span class="tip">simple tip activated span</span>

We can use the following call:

<?php simpletip('span.tip', array('content' => 'Span simple tip', 'position' => 'right')) ?>

That will initialize the SimpleTip jQuery Plugin for all span elements with tip class, inside the HTML document. As you can see, the span has no title attribute, but we have given it from the configuration array, available as a second argument for the SimpleTip Helper. We can further extend the configuration by simple appending more configuration options to the array. For more information about the available SimpleTip configuration options please read the documentation.

The above PHP code will output:

<script type="text/javascript">
    "content":"Span simple tip"});


For complex configurations and in order to avoid code repetition, trSimpleTipPlugin makes use of profiles:

  • config/app.yml

          position:         left
          showEffect:       fade
          hideEffect:       fade
          baseClass:        simpletip

    This is the default profile.

  • config/app.yml

          position:         right
          showEffect:       slide
          hideEffect:       slide
          baseClass:        simpletip

    If we have a custom profile my_custom_profile we can easily make us of this profile:

    <?php simpletip('span.tip', array('content' => 'Some content'), 'my_custom_profile');

    Of course, any configuration option will override the ones defined in the profile.


This plugin is sponsored by Tremend Software Consulting

Tremend Software Consulting