From 445dc8abcf3137c4bc89850b9a38a52f616dce12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot=20=28=40U-Exp=29?= Date: Fri, 12 Sep 2014 14:08:01 +0200 Subject: [PATCH] Add template response, we will do tests by this interface --- appinfo/routes.php | 3 ++- controller/smscontroller.php | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/appinfo/routes.php b/appinfo/routes.php index 7f7167c..4ce3e32 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -22,5 +22,6 @@ namespace OCA\OcSms\AppInfo; $application = new Application(); $application->registerRoutes($this, array('routes' => array( - array('name' => 'sms#push', 'url' => '/push', 'verb' => 'GET'), + array('name' => 'sms#index', 'url' => '/', 'verb' => 'GET'), + array('name' => 'sms#push', 'url' => '/push', 'verb' => 'POST'), ))); diff --git a/controller/smscontroller.php b/controller/smscontroller.php index 23341ab..a7078b1 100644 --- a/controller/smscontroller.php +++ b/controller/smscontroller.php @@ -25,7 +25,13 @@ class SmsController extends Controller { $this->userId = $userId; } - public function push($json_datas) { + public function index() { + $templateName = 'main'; // will use templates/main.php + $parameters = array('key' => 'hi'); + return new TemplateResponse($this->appName, $templateName, $parameters); + } + + public function push($json_datas) { var_dump($json_datas); return array("test" => "test2"); }