本文整理汇总了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);
}