Part on Useful names and conventions finished
This commit is contained in:
parent
20aee0812f
commit
d907e90218
7 changed files with 18 additions and 18 deletions
18
controllers/notes/show.php
Normal file
18
controllers/notes/show.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
$username = 'appUser';
|
||||
$password = 'password';
|
||||
$config = require('config.php');
|
||||
$db = new Database($config['database'], $username, $password);
|
||||
|
||||
$heading = "Note";
|
||||
$currentUserId = 1;
|
||||
|
||||
$note = $db->query('select * from notes where id = :id', [
|
||||
'id' => $_GET['id']
|
||||
])->findOrFail();
|
||||
|
||||
authorize(($note['user_id'] === $currentUserId));
|
||||
|
||||
|
||||
//dd($notes);
|
||||
require "views/notes/show.view.php";
|
||||
Loading…
Add table
Add a link
Reference in a new issue