Skip to content

Feature: AJAX route option #2310

Description

@MGatner

I would like a way to differentiate route definitions for AJAX calls. It would work similar to the hostname/subdomain limits:

$routes->add('from', 'to', ['ajax' => true]);

I typically use forms that either AJAX submit or POST directly based on a few factors, and it would be helpful to have them point to one URL but have AJAX requests use a separate API controller, something like:

$routes->resource('photos', ['ajax' => true, 'controller' =>'App\Controllers\API\Photos']);
$routes->presenter('photos');

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions