Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 30a27eb0b9
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (19 sloc) 0.405 kb
class PostsController extends AppController {
var $name = 'Posts';
function index() {
$this->set('posts', $this->Post->find('all'));
function view($id) {
$this->Post->id = $id;
$this->set('post', $this->Post->read());
function add() {
if (!empty($this->data)) {
if ($this->Post->save($this->data)) {
$this->flash('Your post has been saved.', '/posts');
Jump to Line
Something went wrong with that request. Please try again.