当前位置: 首页>>代码示例>>PHP>>正文


PHP Response::instance方法代码示例

本文整理汇总了PHP中Response::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Response::instance方法的具体用法?PHP Response::instance怎么用?PHP Response::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Response的用法示例。


在下文中一共展示了Response::instance方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getInstance

 /**
  * Returns an instance of Request object
  * @return Request
  */
 public static function getInstance()
 {
     if (self::$instance === null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:reinfire,项目名称:arfooo,代码行数:11,代码来源:Response.php

示例2: getInstance

 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:arielcr,项目名称:mvc-framework,代码行数:7,代码来源:Response.php

示例3: getInstance

 /**
  * @return Response
  */
 public static function getInstance()
 {
     if (!self::$instance instanceof Response) {
         self::$instance = new Response();
     }
     return self::$instance;
 }
开发者ID:joksnet,项目名称:php-old,代码行数:10,代码来源:Response.php

示例4: getInstance

 /**
  * получаем экземпляр объекта
  * необходим при испоьзовании HMVC
  * 
  */
 function getInstance($redirect_if_not_ajax = TRUE)
 {
     if (is_null(self::$instance)) {
         self::$instance = new Response($redirect_if_not_ajax);
     }
     return self::$instance;
 }
开发者ID:radumargina,项目名称:corden,代码行数:12,代码来源:response_helper.php

示例5: __construct

 public function __construct()
 {
     parent::__construct();
     $this->parent_nav_active = 'manage';
     $this->child_nav_active = 'collect';
     $this->grandchild_nav_active = 'collect';
     $this->rsp = Response::instance();
 }
开发者ID:plusjade,项目名称:pluspanda-php,代码行数:8,代码来源:form.php

示例6: getInstance

 /**
  * @static
  * @return Response
  */
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         $c = __CLASS__;
         self::$instance = new $c();
     }
     return self::$instance;
 }
开发者ID:Okhremchuk,项目名称:Ingenum,代码行数:12,代码来源:class.Response.php

示例7: exec

 public function exec()
 {
     $class_name = 'Resource_' . str_replace('/', '_', $this->get_resource());
     $class = new ReflectionClass($class_name);
     $resource = $class->newInstance($this);
     $class->getMethod('before')->invoke($resource);
     $class->getMethod($this->request_method)->invoke($resource);
     $class->getMethod('after')->invoke($resource);
     $response = Response::instance();
     $response->set_body($resource->get_data());
     return $response;
 }
开发者ID:sxhao,项目名称:resty-1,代码行数:12,代码来源:request.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $this->parent_nav_active = 'manage';
     $this->active_tag = isset($_GET['tag']) ? $_GET['tag'] : 'all';
     $this->publish = isset($_GET['publish']) ? $_GET['publish'] : NULL;
     $this->active_rating = isset($_GET['rating']) ? $_GET['rating'] : 'all';
     $this->active_range = isset($_GET['range']) ? $_GET['range'] : 'all';
     $this->active_page = (isset($_GET['page']) and is_numeric($_GET['page'])) ? $_GET['page'] : 1;
     $this->testimonial_id = isset($_GET['id']) ? valid::id_key($_GET['id']) : NULL;
     # prep the ajax response
     $this->rsp = Response::instance();
 }
开发者ID:plusjade,项目名称:pluspanda-php,代码行数:13,代码来源:manage.php

示例9: change_password

 public function change_password()
 {
     if (!$_POST) {
         die;
     }
     $old_pw = $_POST['old_pw'];
     $salt = $this->auth->find_salt($this->owner->password);
     $old_pw = $this->auth->hash_password($old_pw, $salt);
     $this->rsp = Response::instance();
     if ($old_pw == $this->owner->password) {
         $this->owner->password = $_POST['new_pw'];
         $this->owner->save();
         $this->rsp->status = 'success';
         $this->rsp->msg = 'Password Changed!';
         $this->rsp->send();
     }
     $this->rsp->msg = 'Invalid Password!';
     $this->rsp->send();
 }
开发者ID:plusjade,项目名称:pluspanda-php,代码行数:19,代码来源:account.php

示例10: __construct

 public function __construct()
 {
     parent::__construct();
     $this->parent_nav_active = 'display';
     $this->rsp = Response::instance();
 }
开发者ID:plusjade,项目名称:pluspanda-php,代码行数:6,代码来源:display.php

示例11: define

<?php

define('DS', DIRECTORY_SEPARATOR);
define('APP_PATH', dirname(__FILE__) . DS);
define('SYS_PATH', realpath(dirname(__FILE__) . DS . '..' . DS . 'system') . DS);
define('RESOURCE_PATH', dirname(__FILE__) . DS . 'classes' . DS . 'resource' . DS);
require SYS_PATH . 'classes' . DS . 'resty' . DS . 'core.php';
require SYS_PATH . 'classes' . DS . 'resty.php';
Resty::instance()->init();
try {
    Request::instance()->exec()->output();
} catch (Route_Exception $e) {
    Response::instance()->set_status(404)->set_body(array('error' => 'Resource Not Found', 'Request' => $_SERVER['REQUEST_URI']))->output();
}
开发者ID:sxhao,项目名称:resty-1,代码行数:14,代码来源:index.php


注:本文中的Response::instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。