itskp-odense/Backend/controller/getPost.php

20 lines
290 B
PHP

<?php
require "../../bootstrap.php";
use Backend\Model\Post;
session_start();
if (!isset($_SESSION['token'])) {
header("location: ../../Frontend/index.php?login=notloggedin");
}
header('Content-Type: application/json;charset=UTF-8');
//HOme.php
$data = Post::all();
echo $data;