index
index.php – lists your todos
<?php
//We are in the Prosper namespace
namespace Prosper;
//Let's configure Prosper
require_once 'config.php';
//Include the header and stylesheet
include_once 'header.php';
//Pull out all of the todo items, stable order
$todos = Query::select() //No arguments is short for select *
->from('todo') //Pull from the 'todo' table
->order('id') //Order by the id column
->execute(); //Execute and return the result set
//Prosper returns a simple array result set
//with each result as an associative array
if(is_array($todos)) {
foreach($todos as $todo) {
//Make a pretty todo
display_todo($todo);
}
}
//Show the "create new" entry
display_create();
//Display the pretty footer
include_once 'footer.php';
?>
This is a pretty basic todo list display. Pull all of the entries with a simple select statement and iterate through them displaying every todo.