public function execute()
 {
     $this->item->setStatus(ToDoItem::STATUS_COMPLETED);
     $manager = DbManager::getInstance();
     $manager->update($this->item);
     header('Location: index.php?action=list');
 }
 public function execute()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $item = new ToDoItem();
         $item->setName(trim($_POST['name']));
         $item->setStatus(ToDoItem::STATUS_ACTIVE);
         $manager = DbManager::getInstance();
         $manager->save($item);
         header('Location: index.php?action=list');
     }
     $this->renderTemplate('form_new.php');
 }