cakephp-ajax

AJAX for CakePHP: A plugin to ease handling AJAX requests.

MIT License

Downloads
151.3K
Stars
56
Committers
9
cakephp-ajax - 3.0.0 Latest Release

Published by dereuromark 9 months ago

CakePHP 5 compatible release

Enjoy

cakephp-ajax - 3.0.0-RC

Published by dereuromark about 1 year ago

CakePHP 5 compatible pre-release

Please test. Once this has been tested and approved, the stable release can be tagged.

cakephp-ajax - 2.1.0

Published by dereuromark almost 2 years ago

Improvements

  • CakePHP 4.2+
  • PHP 7.3+
cakephp-ajax - 2.0.0

Published by dereuromark over 4 years ago

CakePHP 4 stable release

DRY (Don't repeat yourself) and easy AJAX handling.

  • Auto-handling via View class mapping and making controller actions available both AJAX and non-AJAX by design.
  • Flash message and redirect (prevention) support.
cakephp-ajax - 2.0.0-rc

Published by dereuromark over 4 years ago

CakePHP 4 compatible pre-release.

Please help to finalize for stable release.

cakephp-ajax - 2.0.0-beta

Published by dereuromark almost 5 years ago

CakePHP 4 compatible pre-release.

Please help to finalize for stable release.

cakephp-ajax - 1.5.1

Published by dereuromark almost 5 years ago

Improvements

Removed deprecations.

cakephp-ajax - 1.5.0

Published by dereuromark almost 5 years ago

Improvements

AjaxView extends AppView

This way the AjaxView automatically shares the AppView helpers loaded.
With CakePHP 3 now shifting helper loading from controller to view level this is a required chance at this point to have the AJAX templates being able to use the same helpers as the normal ones do.

Caution
All CakePHP 3 apps by now should have an AppView class present.
If you don't yet, please do that now before pulling this minor release.

cakephp-ajax - 1.4.1

Published by dereuromark over 5 years ago

Bugfixes

Any non-null values for error/success can now be used, so boolean true/false would now work.

Also allow "success" key to skip rendering, similar to "error". Sometimes a bool is not enough and you need to transport a more meaningful message here.

This can be used for edit-in-place AJAX or alike.

cakephp-ajax - 1.4.0

Published by dereuromark over 5 years ago

Improvements

Enable AJAX delete

For usability reasons you might want to delete a row in a paginated table, without the need to refresh the whole page.
All you need to do here is

  • Add a specific class to the "post link"
  • Add some custom JS to catch the "post link JS"
  • Make sure the AjaxComponent is loaded for this action

The default bake action usually already works perfectly:

public function delete($id = null) {
    $this->request->allowMethod(['post', 'delete']);
    $group = $this->Groups->get($id);

    $this->Groups->delete($group);
    $this->Flash->success(__('The group has been deleted.'));

    return $this->redirect(['action' => 'index']);
}

The JSON response even contains the flash message and redirect URL in case you want to use that in your JS response handling.

A live example can be found in the Sandbox.

cakephp-ajax - 1.3.1

Published by dereuromark over 5 years ago

Bugfixes

Adjusted JSON response to not contain invalid UTF8 part.

cakephp-ajax - 1.3.0

Published by dereuromark almost 6 years ago

Improvements

Added AjaxMiddleware for newer CakePHP setups.
Big thanks to @Zuluru for enabling this.

cakephp-ajax - 1.2.0

Published by dereuromark over 6 years ago

Adjustments

CakePHP 3.5+ from here on due to PHP 7.2 compatibility.

cakephp-ajax - 1.1.1

Published by dereuromark almost 7 years ago

Bugfixes

  • Re-organized and arranged the render and _serialize methods in order to fix a bug that occured when _serialize is set to true (thanks to @joshrhykerd).
cakephp-ajax - CakePHP 3.4 release

Published by dereuromark over 7 years ago

This release is for CakePHP 3.4+.

The responses in tests return a slightly different result, so they needed to be adjusted.

cakephp-ajax - Allow for serialize true support

Published by dereuromark almost 9 years ago

With serialize true all vars are always serialized by default.
A change from 3.1. Now this is supported, as well.

cakephp-ajax - Bugfix: Always pass messages along if possible

Published by dereuromark about 9 years ago

The messages were only passed in JSON response for redirects, should also happen for non redirect responses, though.

cakephp-ajax - Initial Release for CakePHP 3.x

Published by dereuromark about 9 years ago

This aims to be the first release, targeting CakePHP 3.1+
Use a previous commit for 3.0 (note that there there was no viewBuilder() yet).

It works for 3.1.1+ again to be exact as there were minor regressions in the way custom View classes were included in 3.1.0.

Package Rankings
Top 5.97% on Packagist.org
Badges
Extracted from project README
CI Coverage Status Minimum PHP Version Coding Standards
Related Projects