|
@@ -30,8 +30,6 @@ class BlogController {
|
|
|
],
|
|
|
];
|
|
|
|
|
|
-
|
|
|
- // Default: http://blog, not http://blog/
|
|
|
public function fifiAction(Application $app, $id) {
|
|
|
return "<h1>Fifi action {$id} </h1>\n";
|
|
|
}
|
|
@@ -45,14 +43,9 @@ class BlogController {
|
|
|
return $output;
|
|
|
}
|
|
|
|
|
|
- // Default: http://blog, not http://blog/
|
|
|
- public function show(Application $app, $id) {
|
|
|
- if (!isset (static::POSTS[$id])) {
|
|
|
- // Will trigger the error() (or built-in) error handler.1
|
|
|
- $app->abort(Response::HTTP_NOT_FOUND, "Post $id does not exist.");
|
|
|
- }
|
|
|
- $post = static::POSTS[$id];
|
|
|
- return "<h1> {$post['title']}</h1>" . "<p> {$post['body']} </p>";
|
|
|
+ public function index2() {
|
|
|
+ return "<p>From mount point</p>\n"
|
|
|
+ . $this->index();
|
|
|
}
|
|
|
|
|
|
// Encode response manually.
|
|
@@ -64,4 +57,15 @@ class BlogController {
|
|
|
public function jsonView() {
|
|
|
return static::POSTS;
|
|
|
}
|
|
|
+
|
|
|
+ // Default: http://blog, not http://blog/
|
|
|
+ public function show(Application $app, $id) {
|
|
|
+ if (!isset (static::POSTS[$id])) {
|
|
|
+ // Will trigger the error() (or built-in) error handler.1
|
|
|
+ $app->abort(Response::HTTP_NOT_FOUND, "Post $id does not exist.");
|
|
|
+ }
|
|
|
+ $post = static::POSTS[$id];
|
|
|
+ return "<h1> {$post['title']}</h1>" . "<p> {$post['body']} </p>";
|
|
|
+ }
|
|
|
+
|
|
|
}
|