views:

77

answers:

1

Hi, How can i write ["Content-Type"] = "text/xml" in cakephp and in which file i have to include that one.

Please Help.

Thanks.

+3  A: 

The Cake way is to use RequestHandlerComponent::respondAs, like
$this->RequestHandler->respondAs('xml'), somewhere in the controller. This may even happen automatically if your app is set up appropriately.

The PHP way is to issue header('Content-Type: text/xml') anywhere before any output (usually somewhere in the controller).

deceze