waJsonActions

Container for multiple AJAX request processing controllers returning response as JSON string

Contents...

Parent class: waController.

This controller is similar to waJsonController with the exception that within one class you can have more than one AJAX request handler for different action_id values. Each action_id in this container class must be represented bya public method named by rule [action_id]Action; e.g., saveAction.

Example of a waJsonActions-based controller:

<?php

class myappBackendSettingsActions extends waJsonActions
{
    public function saveAction()
    {
        $settings = waRequest::post(
            'settings',
            array(),
            waRequest::TYPE_ARRAY
        );
        //...
    }

    public function resetAction()
    {
        //...
    }

    public function deleteAction()
    {
        //...
    }
}