1
0
mirror of https://github.com/nextcloud/ocsms.git synced 2026-08-21 13:23:04 +00:00

Create a basic SmsController

This commit is contained in:
Loïc Blot (@U-Exp)
2014-09-12 13:59:19 +02:00
parent 8d03780e6f
commit 3ad96daa21
4 changed files with 42 additions and 65 deletions
+8 -9
View File
@@ -14,7 +14,7 @@ namespace OCA\OcSms\AppInfo;
use \OCP\AppFramework\App;
use \OCA\OcSms\Controller\PageController;
use \OCA\OcSms\Controller\SmsController;
class Application extends App {
@@ -28,9 +28,10 @@ class Application extends App {
/**
* Controllers
*/
$container->registerService('PageController', function($c) {
return new PageController(
$c->query('AppName'),
$container->registerService('SmsController', function($c) {
return new SmsController(
$c->query('AppName'),
$c->query('Request'),
$c->query('UserId')
);
@@ -42,9 +43,7 @@ class Application extends App {
*/
$container->registerService('UserId', function($c) {
return \OCP\User::getUser();
});
});
}
}
}
+1 -2
View File
@@ -22,6 +22,5 @@ namespace OCA\OcSms\AppInfo;
$application = new Application();
$application->registerRoutes($this, array('routes' => array(
array('name' => 'page#index', 'url' => '/', 'verb' => 'GET'),
array('name' => 'page#do_echo', 'url' => '/echo', 'verb' => 'POST'),
array('name' => 'sms#push', 'url' => '/push', 'verb' => 'POST'),
)));