Browse Source

added new route to the routes file

Patrick Falls 12 years ago
parent
commit
36e7f0e670

+ 6 - 1
php-phalcon/app/config/routes.php

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

+ 2 - 2
php-phalcon/app/controllers/BenchController.php

@@ -75,7 +75,7 @@ class BenchController extends \Phalcon\Mvc\Controller
             $world = Worlds::findFirst(mt_rand(1, 10000));
             $world->randomNumber = mt_rand(1, 10000);
             $world->save();
-            $worlds[] = $world
+            $worlds[] = $world;
         }
 
         return $this->sendContentAsJson($worlds);
@@ -86,4 +86,4 @@ class BenchController extends \Phalcon\Mvc\Controller
         $response->setHeader("Content-Type", "application/json");
         return $response;
     }
-}
+}