-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpagecontroller.php
41 lines (32 loc) · 1.07 KB
/
pagecontroller.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace OCA\test\Controller;
use \OCA\AppFramework\Controller\Controller;
use \OCP\User;
use \OCA\AppFramework\Http\TemplateResponse;
use \OCA\AppFramework\Http\Request;
class PageController extends Controller {
public function __construct($api, $request){
parent::__construct($api, $request);
}
/**
* ATTENTION!!!
* The following comments turn off security checks
* Please look up their meaning in the documentation!
*
* @CSRFExemption
* @IsAdminExemption
* @IsSubAdminExemption
*/
public function index(){
$query = \OCP\DB::prepare("SELECT * FROM *PREFIX*msg WHERE message_to=?");
$results = $query->execute(array(USER::getUser()));
$message = $results->fetchAll();
$response = new TemplateResponse($this->api, 'main');
$response->renderAs("user");
$params = array('messages' => $message,
'msg' => "hallo sch welt...");
$response->setParams($params);
$response->render();
return $this->render('main', array('messages' => "hallo again"));
}
}