当前位置: 首页>>代码示例>>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;未经允许,请勿转载。