A AclBase AclBehavior AclComponent AclNode AclShell Aco AcoAction AjaxHelper ApcEngine ApiShell App AppController AppController AppHelper AppHelper AppModel AppModel Aro AuthComponent B BakeShell BakeTask BehaviorCollection C Cache CacheEngine CacheHelper CakeErrorController CakeLog CakeRoute CakeSchema CakeSession CakeSocket ClassRegistry Component Configure ConnectionManager ConsoleShell ContainableBehavior Controller ControllerTask CookieComponent D DataSource DbAcl DbAclSchema DbConfigTask DboMssql DboMysql DboMysqlBase DboMysqli DboOracle DboPostgres DboSource DboSqlite Debugger Dispatcher E EmailComponent ErrorHandler ErrorHandler ExtractTask F File FileEngine FileLog FixtureTask Folder FormHelper H Helper HtmlHelper HttpSocket I I18n I18nModel i18nSchema I18nShell Inflector IniAcl J JavascriptHelper JqueryEngineHelper JsBaseEngineHelper JsHelper L L10n M MagicDb MagicFileResource MediaView MemcacheEngine Model ModelBehavior ModelTask MootoolsEngineHelper Multibyte N NumberHelper O Object Overloadable Overloadable Overloadable2 Overloadable2 P PagesController PagesController PaginatorHelper Permission PluginShortRoute PluginTask ProjectTask PrototypeEngineHelper R RequestHandlerComponent Router RssHelper S Sanitize Scaffold ScaffoldView SchemaShell Security SecurityComponent SessionComponent SessionHelper SessionsSchema Set Shell ShellDispatcher String T TemplateTask TestSuiteShell TestTask TextHelper ThemeView TimeHelper TranslateBehavior TreeBehavior V Validation View ViewTask X XcacheEngine Xml XmlElement XmlHelper XmlManager XmlNode XmlTextNode

respondAs

line:704 at /cake/libs/controller/components/request_handler.php
Sets the response header based on type map index name. If DEBUG is greater than 2, the header is not set.

Method

(boolean) respondAs ($type, $options = array())

Parameters

ParameterTypeCommentDefault
$type mixed required Friendly type name, i.e. 'html' or 'xml', or a full content-type, like 'application/x-shockwave'.
$options array optional If $type is a friendly type name that is associated with more than one type of content, $index is used to select which content-type to use. array()

Return

boolean

Comment

Sets the response header based on type map index name. If DEBUG is greater than 2, the header
is not set.

@param mixed $type Friendly type name, i.e. 'html' or 'xml', or a full content-type,
like 'application/x-shockwave'.
@param array $options If $type is a friendly type name that is associated with
more than one type of content, $index is used to select which content-type to use.
@return boolean Returns false if the friendly type name given in $type does
not exist in the type map, or if the Content-type header has
already been set by this method.
@access public
@see RequestHandlerComponent::setContent()