Add a helper method for setting content types
authorChuck Hagenbuch <chuck@horde.org>
Tue, 2 Nov 2010 13:20:18 +0000 (09:20 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Tue, 2 Nov 2010 13:20:18 +0000 (09:20 -0400)
framework/Controller/lib/Horde/Controller/Response.php

index 39581d8..2e3da64 100644 (file)
@@ -25,6 +25,11 @@ class Horde_Controller_Response
         $this->_headers[$name] = $value;
     }
 
+    public function setContentType($contentType, $charset = 'UTF-8')
+    {
+        $this->setHeader('Content-Type', "$contentType; charset=$charset");
+    }
+
     public function setBody($body)
     {
         $this->_body = $body;