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"); }