PHPackages                             dm/ajaxcom - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dm/ajaxcom

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dm/ajaxcom
==========

Controls Ajax from PHP

v1.6.2(8y ago)1816.4k↓50%5[7 issues](https://github.com/everlutionsk/AjaxCom/issues)MITJavaScriptPHP &gt;=5.3.3

Since Mar 8Pushed 8y ago19 watchersCompare

[ Source](https://github.com/everlutionsk/AjaxCom)[ Packagist](https://packagist.org/packages/dm/ajaxcom)[ RSS](/packages/dm-ajaxcom/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (25)Used By (0)

[![Build Status](https://camo.githubusercontent.com/efad9832eb2f3b75ecc45b000d91f633e3bd73cbd534c4d22b7255476f2ea8eb/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f657665726c7574696f6e736b2f416a6178436f6d2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/everlutionsk/AjaxCom/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/889d6cf1e8198f81cd5925f511838b709a2cea8a7b7b52a244a7176d6e616a24/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f657665726c7574696f6e736b2f416a6178436f6d2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/everlutionsk/AjaxCom/?branch=master)

AjaxCom
=======

[](#ajaxcom)

AjaxCom is a PHP library that allows developers to write their ajax code in PHP with minimal javascript.

### Demo

[](#demo)

Features
--------

[](#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
------------

[](#requirements)

- PHP &gt;= 5.3.3
- jQuery &gt;= 1.7.x

Installation
------------

[](#installation)

Via composer:

```
{
    "require": {
        "dm/ajaxcom": "dev-master"
    }
}
```

Usage
-----

[](#usage)

### Javascript

[](#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:

```
$(document).ajaxcom();
```

Or just intercept those which have `data-ajaxcom`

```
$(document).ajaxcom('[data-ajaxcom]');
```

### 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('This is a new row');
    // Replace element with some new html
    $handler->container('#something')
        ->replaceWith('Some text');
    // Display modal
    $handler->modal(
        '

                &times;
                Modal header

                One fine body.

                Close
                Save changes

        '
    );

    // 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
}
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~97 days

Recently: every ~59 days

Total

18

Last Release

3156d ago

Major Versions

v0.1.0 → 1.12014-05-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c125639a9c5c2bfd86376c10a243fabd78acd9f50826cd6066aac48c194d8b2?d=identicon)[everlution](/maintainers/everlution)

---

Top Contributors

[![nmpolo](https://avatars.githubusercontent.com/u/1206982?v=4)](https://github.com/nmpolo "nmpolo (32 commits)")[![mdemo](https://avatars.githubusercontent.com/u/1333913?v=4)](https://github.com/mdemo "mdemo (32 commits)")[![klinec](https://avatars.githubusercontent.com/u/5071231?v=4)](https://github.com/klinec "klinec (24 commits)")[![ivanbarlog](https://avatars.githubusercontent.com/u/2583610?v=4)](https://github.com/ivanbarlog "ivanbarlog (8 commits)")[![pekand](https://avatars.githubusercontent.com/u/6358250?v=4)](https://github.com/pekand "pekand (2 commits)")[![martinadamik](https://avatars.githubusercontent.com/u/22906734?v=4)](https://github.com/martinadamik "martinadamik (2 commits)")[![deftomat](https://avatars.githubusercontent.com/u/5549148?v=4)](https://github.com/deftomat "deftomat (1 commits)")[![adam-hornik](https://avatars.githubusercontent.com/u/26869695?v=4)](https://github.com/adam-hornik "adam-hornik (1 commits)")

---

Tags

ajax

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dm-ajaxcom/health.svg)

```
[![Health](https://phpackages.com/badges/dm-ajaxcom/health.svg)](https://phpackages.com/packages/dm-ajaxcom)
```

###  Alternatives

[kartik-v/yii2-tree-manager

An enhanced tree management module with tree node selection and manipulation using nested sets.

156529.0k15](/packages/kartik-v-yii2-tree-manager)[ziffmedia/nova-select-plus

A Nova select field for simple and complex select inputs

96578.4k1](/packages/ziffmedia-nova-select-plus)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73142.3k25](/packages/jaxon-php-jaxon-core)[demogorgorn/yii2-ajax-submit-button

AjaxSubmitButton renders an ajax button which is very similar to ajaxSubmitButton from Yii1.

29132.8k1](/packages/demogorgorn-yii2-ajax-submit-button)[risul/laravel-like-comment

Ajax based site wide like and comment system for laravel

1116.9k](/packages/risul-laravel-like-comment)[lampjunkie/php-datatables

PHP Library for (http://www.datatables.net)

5817.4k](/packages/lampjunkie-php-datatables)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
