本文整理汇总了PHP中REST::ARGS方法的典型用法代码示例。如果您正苦于以下问题:PHP REST::ARGS方法的具体用法?PHP REST::ARGS怎么用?PHP REST::ARGS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类REST
的用法示例。
在下文中一共展示了REST::ARGS方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: response_code
}
}
}
public static $named_codes = array("forbidden" => 403, "not-found" => 404, "bad-method" => 405, "failure" => 406, "success" => 200, "created" => 201, "empty" => 204);
public static function response_code($id = false, $doSend = true)
{
if (!$id) {
return http_response_code();
}
$i = strtolower($id);
if (array_key_exists($i, REST::$named_codes)) {
$code = REST::$named_codes[$i];
} else {
$code = $id;
}
if ($doSend) {
http_response_code($code);
}
return $code;
}
}
if (isset($_REQUEST['_url'])) {
$uri = $_REQUEST['_url'];
if (strpos($uri, "/") === 0) {
$uri = substr($uri, 1);
}
$uri = trim($uri, "/");
REST::$URI = $uri;
REST::$ARGS = explode("/", $uri);
REST::$REQUEST_METHOD = strtoupper($_SERVER["REQUEST_METHOD"]);
}