Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0adab22

Browse files
Clean up
1 parent 6460df4 commit 0adab22

File tree

3 files changed

+3
-28
lines changed

3 files changed

+3
-28
lines changed

‎app/controllers/Pages.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@ class Pages extends Controller
33
{
44
public function __construct()
55
{
6-
// !!! Only for testing the connection to the database
7-
$this->postModel = $this->model('Post');
6+
87
}
98

109
public function index()
1110
{
12-
$posts = $this->postModel->getPosts();
13-
1411
$data = [
15-
'title' => 'Welcome',
16-
'posts' => $posts
12+
'title' => 'Basic PHP MVC structure'
1713
];
1814

1915
$this->view('pages/index', $data);

‎app/models/Post.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎app/views/pages/index.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<?php require APPROOT . '/views/inc/header.php'; ?>
22

33
<h1> <?= $data['title']; ?> </h1>
4-
<ul>
5-
<?php foreach($data['posts'] as $post) : ?>
6-
<li><?= $post->title; ?></li>
7-
<?php endforeach; ?>
8-
</ul>
4+
<p>Included router functionality, folder structure, database class.</p>
95

106
<?php require APPROOT . '/views/inc/footer.php'; ?>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /