Пример #1
0
 /**
  * Instructs the router to parse out file extensions from the URL.
  *
  * For example, http://example.com/posts.rss would yield a file extension of "rss".
  * The file extension itself is made available in the controller as
  * `$this->params['ext']`, and is used by the RequestHandler component to
  * automatically switch to alternate layouts and templates, and load helpers
  * corresponding to the given content, i.e. RssHelper. Switching layouts and helpers
  * requires that the chosen extension has a defined mime type in `CakeResponse`
  *
  * A list of valid extension can be passed to this method, i.e. Router::parseExtensions('rss', 'xml');
  * If no parameters are given, anything after the first . (dot) after the last / in the URL will be
  * parsed, excluding querystring parameters (i.e. ?q=...).
  *
  * @return void
  * @see RequestHandler::startup()
  */
 public static function parseExtensions()
 {
     static::$_parseExtensions = true;
     if (func_num_args() > 0) {
         static::setExtensions(func_get_args(), false);
     }
 }
Пример #2
0
 /**
  * Instructs the router to parse out file extensions from the URL.
  *
  * For example, http://example.com/posts.rss would yield a file extension of "rss".
  * The file extension itself is made available in the controller as
  * `$this->params['ext']`, and is used by the RequestHandler component to
  * automatically switch to alternate layouts and templates, and load helpers
  * corresponding to the given content, i.e. RssHelper. Switching layouts and helpers
  * requires that the chosen extension has a defined mime type in `CakeResponse`
  *
  * A list of valid extension can be passed to this method, i.e. Router::parseExtensions('rss', 'xml');
  * If no parameters are given, anything after the first . (dot) after the last / in the URL will be
  * parsed, excluding querystring parameters (i.e. ?q=...).
  *
  * @return void
  * @see RequestHandler::startup()
  */
 public static function parseExtensions()
 {
     static::$_parseExtensions = TRUE;
     if (func_num_args() > 0) {
         static::setExtensions(func_get_args(), FALSE);
     }
 }