コード例 #1
0
ファイル: Abstract.php プロジェクト: pmatsis/JoshuaTree
 /**
  * method used to call http status codes as defined here: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
  * this method automatically fires the events associated with the response status code
  *
  * @param integer $code -- the response code to sent to the sent to the. Defaults to 200
  * @final
  * @access public
  * @return null
  */
 public final function setResponseStatus($code = 200)
 {
     if (isset($this->_status_codes[$code])) {
         $status = $this->_status_codes[$code];
         header("HTTP/1.0 {$code} {$status}");
         /**
          * fire any registered events for the response code
          */
         $this->getRequestEvent();
         $this->_event_obj->fire($code);
     }
 }
コード例 #2
0
ファイル: Event.php プロジェクト: pmatsis/JoshuaTree
 /**
  * wrapper method used to register events with the System_Event_Controller
  * 
  * @param string $type -- the type of events that you want to be fired
  * @param string $name -- the name of the function or method to be executed
  * @static
  * @return null
  */
 public static function add($type, $name)
 {
     self::getEventObj();
     self::$_event_obj->add($type, $name);
 }