Merge branch 'main' of http://git.pb.bib.de/PBBFA23CIV/EIANotesApp
This commit is contained in:
commit
2d133598e8
29
Controller/UserController.php
Normal file
29
Controller/UserController.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace ppa\Controller;
|
||||
|
||||
use ppa\Model\NotesModel;
|
||||
use ppa\Library\View;
|
||||
|
||||
class NotesController
|
||||
{
|
||||
private $notesModel;
|
||||
protected $view;
|
||||
|
||||
public function __construct($view)
|
||||
{
|
||||
$this->notesModel = new NotesModel();
|
||||
$this->view = $view;
|
||||
}
|
||||
|
||||
public function showNotes()
|
||||
{
|
||||
$sortBy = $_GET['sort_by'] ?? 'updated_at';
|
||||
$sortOrder = strtoupper($_GET['sort_order'] ?? 'DESC');
|
||||
|
||||
$this->view->setVars([
|
||||
"notes" => $this->notesModel->selectNotesForUser(2, $sortBy, $sortOrder) //$_SESSION['user_id']
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user