Ejemplo n.º 1
0
});
/**
 * Router::controller will bind a path to a class, using the following schema
 *
 * GET /    => $controller->index();
 * POST /   => $controller->post($decoded_post_body);
 * PUT /    => $controller->put($decoded_post_body);
 * PATCH /    => $controller->patch($decoded_post_body);
 *
 * Path parameters
 *
 * GET|PATCH|POST|PUT|DELETE /path[/path1/path2/...]
 *  if $controller->path() exists, calls $controller->path($path1, $path2, ...)
 *
 * When $controller->path() does not exist
 *
 * GET /path[/path1/path2/...]
 *  calls $controller->get($path, path1, $path1, ..., $_GET);
 * DELETE /path[/path1/path2/...]
 *  calls $controller->delete($path, path1, $path1, ..., $_GET);
 * POST /path[/path1/path2/...]
 *  $controller->post($path, path1, $path1, ..., $decoded_post_body);
 * PUT /path[/path1/path2/...]
 *  calls $controller->put($path, path1, $path1, ..., $decoded_post_body);
 * PATCH /path[/path1/path2/...]
 *  calls $controller->patch($path, path1, $path1, ..., $decoded_post_body);
 *
 * Additional parameters are passed to the class constructor
 */
$app->controller("/products", 'App\\ProductsController', "Custom Name");