- 7.3. Opt_Output_Http class
7.3.4. setContentType() - 7.3.3. sendHeaders()
« Previous - 7.3.5. setHeader()
Next »
7.3.4. setContentType()
| Construct | Method |
|---|---|
| Visibility | public |
| Reference | void setContentType( [ mixed $contentType [, string $charset ]] ) |
| Argument list |
|
Generates the Content-type header. If any of the arguments is not specified or its value is null, it is taken from the OPT configuration. The $contentType can be either the name of the MIME type or the Opt_Output_Http class constant that identifies a particular type:
Opt_Output_Http::HTMLOpt_Output_Http::XHTMLOpt_Output_Http::FORCED_XHTMLOpt_Output_Http::WMLOpt_Output_Http::XMLOpt_Output_Http::TXT
If the OPC library is present, the contentNegotiation configuration directive is allowed. In this case the method uses the Opc_Visit class to verify if the browser supports the specified MIME type.
Do not turn on
contentNegotiationunless you have Open Power Classes installed!
The difference between Opt_Output_Http::XHTML and Opt_Output_Http::FORCED_XHTML is visible only if the content negotiation is active. Opt_Output_Http::FORCED_XHTML generates the XHTML content type always, if browser supports it, while in Opt_Output_Http::XHTML it must also have a higher priority than text/html.
- 7.3.4. setContentType()
7.3. Opt_Output_Http class - « Previous
7.3.3. sendHeaders() - Next »
7.3.5. setHeader()