/** * Factory style constructor works nicer for chaining. This * should also really only be used internally. The Request::get, * Request::post syntax is preferred as it is more readable. * * @param string $method Http Method * @param string $mime Mime Type to Use * * @return Request */ public static function init($method = null, $mime = null) { // Setup our handlers, can call it here as it's idempotent Bootstrap::init(); // Setup the default template if need be if (!isset(self::$_template)) { self::_initializeDefaults(); } $request = new self(); return $request->_setDefaults()->method($method)->sendsType($mime)->expectsType($mime); }