/** * 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. * @return Request * @param string $method Http Method * @param string $mime Mime Type to Use */ 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 Request(); return $request->_setDefaults()->method($method)->sendsType($mime)->expectsType($mime); }