static function run() { $instance = new ApiController(); $result = $instance->processRequest(); $instance->_response($result); }
public function __construct(ApiResponse $response) { parent::__construct(); $this->response = $response; }
<?php /** * Created by PhpStorm. * User: jekyll * Date: 2/8/16 * Time: 11:52 PM */ function NamespacesAutoload($path) { if (preg_match('/\\\\/', $path)) { $path = str_replace('\\', DIRECTORY_SEPARATOR, $path); } if (file_exists("{$path}.php")) { require_once "{$path}.php"; } } spl_autoload_register('NamespacesAutoload'); use Controllers\ApiController; //Only running front controller ApiController::run();