2017 © Pedro Peláez
 

library ajaxcom

Controls Ajax from PHP

image

dm/ajaxcom

Controls Ajax from PHP

  • Wednesday, September 27, 2017
  • by everlution
  • Repository
  • 19 Watchers
  • 15 Stars
  • 7,772 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 7 Open issues
  • 26 Versions
  • 1 % Grown

The README.md

Build Status Scrutinizer Code Quality, (*1)

AjaxCom

AjaxCom is a PHP library that allows developers to write their ajax code in PHP with minimal javascript., (*2)

Demo

http://ajaxcom.everlution.sk/, (*3)

Features

  • Append html to elements
  • Prepend html to elements
  • Replace elements with new html
  • Set html of elements
  • Set value of elements
  • Display flash messages
  • Display modals
  • Change URL
  • Call functions

Requirements

  • PHP >= 5.3.3
  • jQuery >= 1.7.x

Installation

Via composer:, (*4)

``` json { "require": { "dm/ajaxcom": "dev-master" } }, (*5)


## Usage ### Javascript Include the javascript library located at `src/DM/AjaxCom/Resources/public/js/ajaxcom.js` Intercept all click events on anchors and submit events on forms: ``` javascript $(document).ajaxcom();

Or just intercept those which have data-ajaxcom ``` javascript $(document).ajaxcom('[data-ajaxcom]');, (*6)


### PHP ``` php use DM\AjaxCom\Handler; if (isset($_SERVER['X-AjaxCom'])) { // Render page using AjaxCom library $handler = new Handler(); // Change URL to /newurl $handler->changeUrl('/newurl'); // Append some html to an element $handler->container('#table') ->append('<tr><td>This is a new row</td></tr>'); // Replace element with some new html $handler->container('#something') ->replaceWith('<span id="somethingnew">Some text</span>'); // Display modal $handler->modal( ' ' ); // NOTE: It is important to call callback() AFTER container() or modal() // when you are manipulating the rendered DOM inside the callback; // otherwise the callback will be called before elements of DOM are loaded // Call funcname() $handler->callback('funcname'); // Call namespace.funcname() $handler->callback('namespace.funcname'); // You can also specify parameters which will be passed as object to the funcion $handler->callback('namespace.funcname', ['this' => 'will', 'be' => 'passed', 'as' => 'an object', 'to' => 'the function']); header('Content-type: application/json'); echo json_encode($handler->respond()); } else { // Render page normally }

The Versions

27/09 2017

dev-master

9999999-dev

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

27/09 2017

v1.6.2

1.6.2.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

26/09 2017

dev-feature-materialize-modal-remove

dev-feature-materialize-modal-remove

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

07/06 2017

v1.6.1

1.6.1.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

07/06 2017

dev-replace

dev-replace

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

09/05 2017

v1.6.0

1.6.0.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

09/05 2017

dev-feature-39

dev-feature-39

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

22/03 2017

v1.5.0

1.5.0.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

22/03 2017

dev-modern-browsers-upload

dev-modern-browsers-upload

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

02/02 2017

v1.4.4

1.4.4.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

02/02 2017

dev-ivanbarlog-patch-1

dev-ivanbarlog-patch-1

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

02/02 2017

dev-feature-materialize

dev-feature-materialize

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

23/11 2015

dev-feature-load-javascript

dev-feature-load-javascript

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

17/09 2015

1.4.2

1.4.2.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

09/06 2015

1.4.1

1.4.1.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

12/02 2015

1.3.1

1.3.1.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

11/02 2015

1.3.0

1.3.0.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

17/09 2014

1.2.4

1.2.4.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

04/09 2014

1.2.3

1.2.3.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

18/08 2014

1.2.2

1.2.2.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

01/07 2014

1.2.1

1.2.1.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

03/06 2014

1.2

1.2.0.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

15/05 2014

1.1.2

1.1.2.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

07/05 2014

1.1.1

1.1.1.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

06/05 2014

1.1

1.1.0.0

Controls Ajax from PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters

ajax

08/03 2013

v0.1.0

0.1.0.0

  Sources   Download

The Requires

  • php >=5.3.3

 

The Development Requires

by Miroslav Demovic
by Nick Masters