Adding documentation for a new feature.

This commit is contained in:
mark_story 2010-09-09 22:02:36 -04:00
parent 4a0e34a0d6
commit f8dbeb2b70

View file

@ -488,6 +488,16 @@ class RequestHandlerComponent extends Component {
/** /**
* Sets the layout and template paths for the content type defined by $type. * Sets the layout and template paths for the content type defined by $type.
* *
* ### Usage:
*
* Render the response as an 'ajax' response.
*
* `$this->RequestHandler->renderAs($this, 'ajax');`
*
* Render the response as an xml file and force the result as a file download.
*
* `$this->RequestHandler->renderAs($this, 'xml', array('attachment' => 'myfile.xml');`
*
* @param object $controller A reference to a controller object * @param object $controller A reference to a controller object
* @param string $type Type of response to send (e.g: 'ajax') * @param string $type Type of response to send (e.g: 'ajax')
* @param array $options Array of options to use * @param array $options Array of options to use
@ -536,8 +546,8 @@ class RequestHandlerComponent extends Component {
} }
/** /**
* Sets the response header based on type map index name. If DEBUG is greater than 2, the header * Sets the response header based on type map index name. This wraps several methods
* is not set. * available on CakeResponse. It also allows you to use Content-Type aliases.
* *
* @param mixed $type Friendly type name, i.e. 'html' or 'xml', or a full content-type, * @param mixed $type Friendly type name, i.e. 'html' or 'xml', or a full content-type,
* like 'application/x-shockwave'. * like 'application/x-shockwave'.
@ -601,6 +611,7 @@ class RequestHandlerComponent extends Component {
* *
* @param mixed $cType Either a string content type to map, or an array of types. * @param mixed $cType Either a string content type to map, or an array of types.
* @return mixed Aliases for the types provided. * @return mixed Aliases for the types provided.
* @deprecated Use $this->response->mapType() in your controller instead.
*/ */
public function mapType($cType) { public function mapType($cType) {
return $this->response->mapType($cType); return $this->response->mapType($cType);