@@ -89,7 +89,7 @@ index 5dfd2c3..fdd8c16 100644
89
89
"version": "2.3.3",
90
90
"target-dir": "Zend/Log",
91
91
diff --git a/controllers.php b/controllers.php
92
- index 9adb562..4de8eb7 100644
92
+ index 9adb562..b986cd9 100644
93
93
--- a/controllers.php
94
94
+++ b/controllers.php
95
95
@@ -8,13 +8,10 @@ use Pimple\Container;
@@ -110,10 +110,11 @@ index 9adb562..4de8eb7 100644
110
110
111
111
return new Response($content);
112
112
}
113
- @@ -23,17 +20,11 @@ function attendees_controller(Request $request, Container $c) {
113
+ @@ -22,25 +19,17 @@ function homepage_controller(Request $request) {
114
+ function attendees_controller(Request $request, Container $c) {
114
115
$dbh = $c['connection'];
115
116
116
- $sql = 'SELECT * FROM php_camp';
117
+ - $sql = 'SELECT * FROM php_camp';
117
118
- $content = '<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />';
118
119
- $content .= '<h1>PHP Camp Attendees</h1>';
119
120
- $content .= '<table class="table" style="width: 300px;">';
@@ -125,14 +126,23 @@ index 9adb562..4de8eb7 100644
125
126
- );
126
127
- }
127
128
- $content .= '</table>';
128
- + $campers = $dbh->query($sql );
129
+ + $campers = $dbh->query('SELECT * FROM php_camp' );
129
130
+
130
131
+ $content = $c['twig']->render('attendees.twig', array(
131
132
+ 'campers' => $campers
132
133
+ ));
133
134
134
135
return new Response($content);
135
136
}
137
+
138
+ - function error404_controller(Request $request) {
139
+ - $content = '<h1>404 Page not Found</h1>';
140
+ - $content .= '<p>Find a boy (or girl) scout - they can fix this!</p>';
141
+ + function error404_controller(Request $request, Container $c) {
142
+ + $content = $c['twig']->render('error404.twig');
143
+
144
+ $response = new Response($content);
145
+ $response->setStatusCode(404);
136
146
diff --git a/services.php b/services.php
137
147
index b0b1542..1a0248d 100644
138
148
--- a/services.php
@@ -169,6 +179,15 @@ index 0000000..106ec00
169
179
+ </tr>
170
180
+ {% endfor %}
171
181
+ </table>
182
+ diff --git a/views/error404.twig b/views/error404.twig
183
+ new file mode 100644
184
+ index 0000000..27f565e
185
+ --- /dev/null
186
+ +++ b/views/error404.twig
187
+ @@ -0,0 +1,3 @@
188
+ +
189
+ + <h1>404 Page not Found</h1>
190
+ + <p>Find a boy (or girl) scout - they can fix this!</p>
172
191
diff --git a/views/homepage.twig b/views/homepage.twig
173
192
new file mode 100644
174
193
index 0000000..fbe632e
0 commit comments