Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added view action

  • Loading branch information...
commit 4fa282c76665687cc8a61a69f320d64b00b7b2e5 1 parent f0ff3d9
@mariuz authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 app/controllers/posts_controller.php
View
7 app/controllers/posts_controller.php
@@ -4,7 +4,12 @@ class PostsController extends AppController {
var $name = 'Posts';
function index() {
- $this->set('posts', $this->Post->find('all'));
+ $this->set('posts', $this->Post->find('all'));
+ }
+
+ function view($id = null) {
+ $this->Post->id = $id;
+ $this->set('post', $this->Post->read());
}
}
?>
Please sign in to comment.
Something went wrong with that request. Please try again.