2017 © Pedro Peláez
 

symfony-bundle jquery-ajax-bundle

This bundle provides a Twig functions that generate js function to send ajax request.

image

mabs/jquery-ajax-bundle

This bundle provides a Twig functions that generate js function to send ajax request.

  • Sunday, July 12, 2015
  • by kernel64
  • Repository
  • 2 Watchers
  • 6 Stars
  • 211 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

# JQueryAjaxBundle SensioLabsInsight

Build Status Scrutinizer Code Quality GitHub issues GitHub stars GitHub license, (*1)

JQueryAjaxBundle for Symfony2., (*2)

Install

To install this bundle on your project, add this line to composer.json file:, (*3)

   "mabs/jquery-ajax-bundle": "~1.0"

This bundle add two Twig functions:, (*4)

1 - ja_request:

To generate a js code to send an ajax request:, (*5)

  {{ ja_request({'update': '#reponse', 'url': path('new')  }) }}

or, (*6)

{{ ja_request({'update': '#reponse', 'url': path('new'), 'after': 'alert("after");', 'before': 'alert("before");', 'complete': 'alert("complete");'  }) }}

=>, (*7)

  $.ajax({ url: "/app_dev.php/new", type: "POST", dataType: "html",beforeSend: function(){alert("before");},success: function( data ){$( "#reponse" ).html(data);alert("after");}});

2 - ja_link:

To generate a link:, (*8)

  {{ ja_link({'update': '#reponse', 'url': path('new'), 'text': 'new link'  }) }}

To add a confirm action on click, you just have to use 'confirm': true, by default the text is "Are you sure you want to perform this action?" then if you want to replace it, use 'confirm_msg': "***"., (*9)

You can also use those parameters 'before' and 'after' to execute JS code., (*10)

3 - License

This bundle is available under the MIT license., (*11)

The Versions

12/07 2015

dev-master

9999999-dev

This bundle provides a Twig functions that generate js function to send ajax request.

  Sources   Download

MIT

The Requires

 

by Mohamed Aymen Ben Slimane

twig ajax symfony jqyuery

19/02 2014

v1.1

1.1.0.0

This bundle provides a Twig functions that generate js function to send ajax request.

  Sources   Download

MIT

The Requires

 

by Mohamed Aymen Ben Slimane

twig ajax symfony jqyuery

29/11 2013

v1.0

1.0.0.0

This bundle provides a Twig functions that generate js function to send ajax request.

  Sources   Download

MIT

The Requires

 

by Mohamed Aymen Ben Slimane

twig ajax symfony jqyuery