# Jquery Plug-In The `sfJqueryPlugin` offers helpers that integrate the [Jquery](http://www.jquery.com/) Javascript framework. *Warning*: This plugin is in Alpha state. Syntax is subject to change. ## Maintainer Please report all bugs to Fourat Zouari <fourat[at]gmail[dot]com> (loca|host on IRC) ## Licence For the full copyright and license information, please view the LICENSE file that was distributed with this source code. ## Introduction Jquery is offering an easy API, very well documented and can be a good replacement for the Prototype framework wich's used by default on symfony Javascript's helper. And since Jquery comes with its powerfull JqueryUI to do effects easily, there's no need to implement scriptaculous. The integration of `sfJqueryPlugin` is made simple, developers will have to use the new `jQuery` helper and prefix the old *prototyped* methods with **jq_**. So the *prototyped* method: <?php echo link_to_remote(....);?> will get this new Jquery form: <?php echo jq_link_to_remote(....);?> ## Installation * Install the plugin $ symfony plugin-install http://plugins.symfony-project.com/sfJqueryPlugin * 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 * Download the jquery file from www.jquery.com and put it in web/js/jq/jquery.js * Clear the cache $ symfony cc ## Basic syntax ### Declaring the helper in templates * Inside the template <?php use_helper('jQuery') ?> * From settings.yml standard_helpers: [jQuery](...,) ### Using Jquery methods To use Jquery methods, refer to *Chapter 11* [Ajax Integration](http://www.symfony-project.com/book/1_0/11-Ajax-Integration), all***** methods described on the chapter can be used with the **jq_** prefix. *[*]: Refere to:* **jQuery Helpers documentation**. ## jQuery Helpers documentation Below are complete syntax for ready to use methods in the jQuery Helpers. * `jq_periodically_call_remote($options = array())` * `jq_link_to_function($name, $function, $html_options = array())` * `jq_link_to_remote($name, $options = array(), $html_options = array())` * `jq_update_element_function($element_id, $options = array())` * `jq_form_remote_tag($options = array(), $options_html = array())` * `jq_submit_to_remote($name, $value, $options = array(), $options_html = array())` * `jq_javascript_tag($content)` These are the methods reconverted into jQuery functions till the `sfJqueryPlugin` last version, future changes will integrate more functions. ## Author ## Todo * Implement the rest of the Javascript Helper: * visual_effect * sortable_element * draggable_element * drop_receiving_element * input_auto_complete_tag * input_in_place_editor_tag * Use **jQuery.** instead of **$.**. ## Changelog ### 2007-10-17 | 0.0.8 Beta * fourat: Fixed data parameter handling in `jq_remote_function()`. ### 2007-10-16 | 0.0.7 Beta * fourat: Fixed dataType parameter handling in `jq_remote_function()`. ### 2007-10-15 | 0.0.6 Beta * fourat: Jquery has fixed the documentation and now providing a dataType:text to forbid script execution in returned data (see ticket [1788](http://dev.jquery.com/ticket/1788)) ### 2007-10-11 | 0.0.5 Beta * fourat: Fixed `method` parameter and data serialisation in `jq_remote_function`. ### 2007-10-10 | 0.0.4 Beta * fourat: Initial release * fourat: Implementing basic ajax functions: * jq_periodically_call_remote * jq_link_to_function * jq_link_to_remote * jq_update_element_function * jq_form_remote_tag * jq_submit_to_remote * jq_javascript_tag