API Documentation for: 1.1.1
Show:

Gateway Class

Namespace: Canteen\Server

This server handles requests made through the gateway and returns JSON data.
Located in the namespace Canteen\Server.

Item Index

Properties

Methods

handle

(
  • uriRequest
)
Object

The main server handler

Parameters:

  • uriRequest String

    The entire URI being requested

Returns:

Object:

The JSON object

internalHandle

(
  • uriRequest
)
Mixed private

The internal JSON handle request

Parameters:

  • uriRequest String

    The URI request being made

Returns:

Mixed:

The result of the service call

register

(
  • uri
  • call
  • [privilege=Privilege::ANONYMOUS]
)

Create a new gateway

Parameters:

  • uri String

    The path to the call

  • call Callable

    The callback for the uri request

  • [privilege=Privilege::ANONYMOUS] Int optional

    The minimum privilege needed to call

Properties

_controls

Dictionary private

The map of controls by uri alias

ERROR

String final static

If the output produced an error

SUCCESS

String final static

If the output was successful

uri

String

The path to this gateway server

Default: 'gateway';