public function view($post) { is_object($post) or $post = $this->getPost((int) $post); // might throw a NotFound, which is caught outside the application // $post->_fill(array('oele' => 'boele')); if (!empty($_POST['body'])) { $post->update(array('body' => $_POST['body'])); return Output::markdown($post->body); } if (!empty($_GET['json'])) { return json_encode(Output::filter($post, array('title', 'body'))); } $messages = Session::messages(); return $this->tpl->display(__METHOD__, get_defined_vars()); }