All Data Structures Namespaces Files Functions Variables
RestfullController Class Reference
Inheritance diagram for RestfullController:

## Public Member Functions

| __construct ($context, $params, $encode_fnc=null)
| start ()
| run ()
Public Member Functions inherited from AController
| __construct ($context, $params)
| start ()

## Private Attributes

| $encode_fnc

## Additional Inherited Members

Protected Attributes inherited from AController
| $params

## Detailed Description

Abstract Controller

Definition at line 8 of file ARestfullController.php.

## Constructor & Destructor Documentation

__construct | ( |  | $context,
|  |  | $params,
|  |  | $encode_fnc = `null`
| ) |  |

Definition at line 12 of file ARestfullController.php.

{
if (!\Entity\Config::getConfig(null, "restfullEnabled", false))
throw new \Exception\Error404();
parent::__construct($context, $params);
if ($encode_fnc === null)
$encode_fnc = array("method" => json_encode, "mime" => "application/json");
$this->encode_fnc = $encode_fnc;
}
Entity
Definition: Address.php:3
Tools\RestfullController\$encode_fnc
$encode_fnc
Definition: ARestfullController.php:10
Tools\AController\$params
$params
Definition: AController.php:18

## Member Function Documentation

run | ( |  | ) |

abstract

start | ( |  | ) |

Definition at line 22 of file ARestfullController.php.

{
//TODO call some hooks
header("Content-Type: {$this->encode_fnc["mime"]}");
echo $this->encode_fnc["method"]($this->run());
//TODO call some hooks
}
Tools\RestfullController\run
run()

## Field Documentation

$encode_fnc

private

Definition at line 10 of file ARestfullController.php.

The documentation for this class was generated from the following file:

- core/tools/ARestfullController.php