Browse Source

adding the plaintext test

Kpacha 11 years ago
parent
commit
b8d9e15f8f

+ 4 - 0
php-phalcon/README.md

@@ -43,3 +43,7 @@ http://localhost/db?queries=2
 ### Templating Test
 
 http://localhost/fortunes
+
+### Plaintext Test
+
+http://localhost/plaintext

+ 5 - 0
php-phalcon/app/config/routes.php

@@ -23,4 +23,9 @@ $router->add('/update', array(
     'action' => 'update',
 ));
 
+$router->add('/plaintext', array(
+    'controller' => 'bench',
+    'action' => 'plaintext',
+));
+
 return $router;

+ 9 - 0
php-phalcon/app/controllers/BenchController.php

@@ -81,6 +81,15 @@ class BenchController extends \Phalcon\Mvc\Controller
         return $this->sendContentAsJson($worlds);
     }
 
+    public function plaintextAction()
+    {
+        $this->view->disable();
+        $this->response->setStatusCode(200, "OK");
+        $this->response->setContentType('text/plain', 'UTF-8');
+        $this->response->setContent("Hello, World!");
+        $this->response->send();
+    }
+
     private function sendContentAsJson($content) {
         $response = new Phalcon\Http\Response(json_encode($content));
         $response->setHeader("Content-Type", "application/json");