Skip to content

CakePHP AjaxJSON responses and HTML fragments

Handle Ajax requests, redirects, and flash messages in CakePHP controllers.

CakePHP Ajax request and response arrows

Start with one action ​

Install the plugin, then follow the Getting started example to call a controller action with the browser's fetch() API.

Choose the response ​

Ajax Component selects Ajax handling for configured actions and request detectors. It can include flash messages and turn controller redirects into JSON responses.

Ajax View renders HTML fragments or serializes view variables. Read the overview to decide when to use the plugin or CakePHP's core JsonView.

Released under the MIT License.