public function view($id = '') { $cards = new Cards($this->db); if (!$cards->count(array('filename=?', $id))) { $this->f3->error(404); } else { $this->f3->set('info', $cards->getByFilename($id)); $this->f3->set('content', 'app/views/cards-view.htm'); echo Template::instance()->render('app/templates/default.htm'); } }