<?php include_once __DIR__ . '/../src/Todo.php'; print_r(Todo::batch_read());
<?php /**Our _todo app's GUI client. *What we have done is just provide an interface that talks to our boring _Todo controller methods. *Notice how we try very hard to decouple php from the html so that we can plug in stuff like *templates easily. */ include_once __DIR__ . '/src/Todo.php'; $items = Todo::batch_read(); ?> <?php //refresh page to reflect new changes function refresh() { header("Location: ."); } //submit/update an item if (isset($_POST) && isset($_POST['title'])) { if ($_POST['title']) { $title = strip_tags(stripslashes($_POST['title'])); if (isset($_POST['id'])) { Todo::update($_POST['id'], $title); } else { Todo::create($title); } } refresh(); } //delete an item if (isset($_GET['delete']) && isset($_GET['id'])) {