public function show_active_poll() { $poll = new poll($this->db, $this->output); if ($_SERVER["REQUEST_METHOD"] == "POST") { $poll->vote($_POST["vote"]); } $poll->to_output(); }
public function execute() { $this->output->title = "Poll demo"; $poll = new poll($this->db, $this->output); if ($_SERVER["REQUEST_METHOD"] == "POST") { $poll->vote($_POST["vote"]); } $poll->to_output(); }