本文整理匯總了PHP中HTTP::status方法的典型用法代碼示例。如果您正苦於以下問題:PHP HTTP::status方法的具體用法?PHP HTTP::status怎麽用?PHP HTTP::status使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HTTP
的用法示例。
在下文中一共展示了HTTP::status方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: abort
/**
* ==========================================================
* RENDER A 404 PAGE
* ==========================================================
*
* -- CODE: -------------------------------------------------
*
* Shield::abort();
*
* ----------------------------------------------------------
*
* Shield::abort('404-custom');
*
* ----------------------------------------------------------
*
*/
public static function abort($name = '404', $fallback = false, $buffer = true)
{
$s = explode('-', $name, 2);
$s = is_numeric($s[0]) ? $s[0] : '404';
Config::set('page_type', $s);
HTTP::status((int) $s);
self::attach($name, $fallback, $buffer);
}
示例2: function
Weapon::add('thumbnail_before', 'do_thumbnail_http_header', 1);
Route::accept('t/(:num)/(:all)', function ($size = 0, $path = "") {
$path = Filter::colon('thumbnail:path', ASSET . DS . File::path($path));
$G = array('data' => array('path' => $path, 'lot' => func_get_args()));
if (!($path = File::exist($path))) {
HTTP::status(404);
exit;
}
Weapon::fire('thumbnail_before', array($G, $G));
Image::take($path)->resize($size)->draw();
}, 12);
Route::accept('t/(:num)/(:num)/(:all)', function ($width = 0, $height = 0, $path = "") {
$path = Filter::colon('thumbnail:path', ASSET . DS . File::path($path));
$G = array('data' => array('path' => $path, 'lot' => func_get_args()));
if (!($path = File::exist($path))) {
HTTP::status(404);
exit;
}
Weapon::fire('thumbnail_before', array($G, $G));
Image::take($path)->crop($width, $height)->draw();
}, 11);
Route::accept('t/(:num)/(:num)/(:num)/(:num)/(:all)', function ($x = 0, $y = 0, $width = 0, $height = 0, $path = "") {
$path = Filter::colon('thumbnail:path', ASSET . DS . File::path($path));
$G = array('data' => array('path' => $path, 'lot' => func_get_args()));
if (!($path = File::exist($path))) {
HTTP::status(404);
exit;
}
Weapon::fire('thumbnail_before', array($G, $G));
Image::take($path)->crop($x, $y, $width, $height)->draw();
}, 10);
示例3: error501
protected function error501()
{
HTTP::status(501);
echo "<h1>501 Not Implemented</h1>";
}
示例4: abort
/**
* ==========================================================
* RENDER A 404 PAGE
* ==========================================================
*
* -- CODE: -------------------------------------------------
*
* Shield::abort();
*
* ----------------------------------------------------------
*
* Shield::abort('404-custom');
*
* ----------------------------------------------------------
*
*/
public static function abort($name = '404', $minify = null, $cache = false, $expire = null)
{
HTTP::status(404);
Config::set('page_type', '404');
self::attach($name, $minify, $cache, $expire);
}