Skip to content

Instantly share code, notes, and snippets.

@JesseObrien
Created January 23, 2013 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JesseObrien/4609086 to your computer and use it in GitHub Desktop.
Save JesseObrien/4609086 to your computer and use it in GitHub Desktop.
Basic controller for todo list
<?php
class Todo_Controller extends Base_Controller
{
public $restful = true;
/**
* Show the list of all items
*/
public function get_index()
{
}
/**
* Show an individual item
*/
public function get_show($todo_id)
{
}
/**
* Show a form to create a new item
*/
public function get_create()
{
}
/**
* Create an item and redirect back to the list
*/
public function post_create()
{
}
/**
* Mark an item completed
*/
public function post_complete($todo_id)
{
}
/**
* Update an item and redirect back to that item
*/
public function post_update($todo_id)
{
}
/**
* Delete an item
*/
public function post_delete($todo_id)
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment