當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HTTP::status方法代碼示例

本文整理匯總了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);
 }
開發者ID:AdeHaze,項目名稱:mecha-cms,代碼行數:24,代碼來源:shield.php

示例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);
開發者ID:tovic,項目名稱:thumbnail-plugin-for-mecha-cms,代碼行數:31,代碼來源:launch.php

示例3: error501

 protected function error501()
 {
     HTTP::status(501);
     echo "<h1>501 Not Implemented</h1>";
 }
開發者ID:pestopancake,項目名稱:oz-php,代碼行數:5,代碼來源:oz.php

示例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);
 }
開發者ID:razordaze,項目名稱:mecha-cms,代碼行數:22,代碼來源:shield.php


注:本文中的HTTP::status方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。