findOneById($id); if ( !is_object($category) ) { header('Location: categories.php'); } $smarty = new Smarty; $smarty->assign('loggedin', isset($_SESSION['username'])); $smarty->assign('products', $category->getProducts()); $smarty->assign('category', $category->getName()); $smarty->assign('id', $id); $smarty->display('products.tpl'); ?>