PHPackages                             markguinn/silverstripe-ajax - 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. markguinn/silverstripe-ajax

ActiveSilverstripe-module[Utility &amp; Helpers](/categories/utility)

markguinn/silverstripe-ajax
===========================

Foundational ajax support for Silverstripe CMS: push/pull server-side regions, trigger client-side events, modals, status messages.

1.0.0(11y ago)86.1k7[1 issues](https://github.com/markguinn/silverstripe-ajax/issues)1MITJavaScript

Since Oct 30Pushed 9y ago4 watchersCompare

[ Source](https://github.com/markguinn/silverstripe-ajax)[ Packagist](https://packagist.org/packages/markguinn/silverstripe-ajax)[ RSS](/packages/markguinn-silverstripe-ajax/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

Silverstripe Frontent Ajax Framework
====================================

[](#silverstripe-frontent-ajax-framework)

Foundational framework-agnostic frontend ajax support for Silverstripe CMS: push/pull server-side regions, trigger client-side events, modals, status messages.

[![Build Status](https://camo.githubusercontent.com/31c851cf1a6ae7ac462254b55f1ca787b9c7c1334ed44a9772647ec0ac750e96/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6d61726b6775696e6e2f73696c7665727374726970652d616a61782e706e67)](http://travis-ci.org/markguinn/silverstripe-ajax)

See [the documentation](docs/en/index.md) for examples and documentation.

Use Case: Add to Shopping Cart
------------------------------

[](#use-case-add-to-shopping-cart)

I want to progressively enhance the "add to cart" button on an ecommerce website. Every page has an summary of the cart (how many items etc) that needs to be kept up to date. Some pages have more extensive visual changes (removing rows from a larger table on the "view cart" page for example).

1. I isolate any regions (such as the side cart) into template includes.
2. I add the "ajax" class to any forms or links that perform the action I want to enhance.
3. The add to cart action on the controller will "push" that sidecart template transparently.
4. Specific pages can "pull" other templates either via data- attributes or javascript.
5. The server can trigger an event such as "cartempty" on the document.body element. I may want to listen for that event and redirect away from the checkout page or display a message.

This covers the vast majority of progressive enhancement cases I've come across working on Silverstripe sites, but gives a lot of flexibility for more complicated stuff.

Features
--------

[](#features)

- Common ajax behaviours are as simple as adding a class
- Trigger jQuery events on the document from the server
- Push template regions from the server (region = template include)
- Pull template regions from the client
- Generic status messages (easy to write an adapter for almost any toast/flash/status message - includes one for toastr)
- Generic modals (easy to write an adapter - includes one for bootstrap)

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

[](#installation)

```
composer require markguinn/silverstripe-ajax:dev-master

```

Include base.js, base.css, and any status message and/or modal adapters.

Requires
--------

[](#requires)

- Silverstripe 3.1+
- jQuery 1.7+ (including current, 2.x etc)

Developer(s)
------------

[](#developers)

- Mark Guinn

Contributions welcome by pull request and/or bug report. Please follow Silverstripe code standards (tests would be nice).

License (MIT)
-------------

[](#license-mit)

Copyright (c) 2014 Mark Guinn

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

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

Unknown

Total

1

Last Release

4212d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/485dfc9fc93cad085c83c3276f19b6e9322ee910ab0e1685de0db42228dbf97b?d=identicon)[markguinn](/maintainers/markguinn)

---

Top Contributors

[![cjsewell](https://avatars.githubusercontent.com/u/1856199?v=4)](https://github.com/cjsewell "cjsewell (3 commits)")[![bummzack](https://avatars.githubusercontent.com/u/1006185?v=4)](https://github.com/bummzack "bummzack (1 commits)")

---

Tags

javascripteventssilverstripeajaxregions

### Embed Badge

![Health badge](/badges/markguinn-silverstripe-ajax/health.svg)

```
[![Health](https://phpackages.com/badges/markguinn-silverstripe-ajax/health.svg)](https://phpackages.com/packages/markguinn-silverstripe-ajax)
```

###  Alternatives

[sheadawson/silverstripe-select2

A set of silverstripe form fields based on http://ivaynberg.github.com/select2/

1923.5k3](/packages/sheadawson-silverstripe-select2)[axllent/silverstripe-cms-tweaks

Several CMS usability improvements

1826.2k1](/packages/axllent-silverstripe-cms-tweaks)[moe/full-calendar

A lightweight calendar module for Silverstripe. Implements the popular javascript http://fullcalendar.io/ library.

121.5k](/packages/moe-full-calendar)

PHPackages © 2026

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