1q2w3e4r Posted February 4, 2014 Share Posted February 4, 2014 (edited) WitamChcę w header.tpl odbierać z adresu strony id kategorii oraz id produktu. Zrobiłem to tak, że dodałem do header.php taki kod: if ($_GET['id_category']) $category = intval($_GET['id_category']); else if ($_GET['id_product']) { $product = new Product(intval($_GET['id_product'])); $category = $product->id_category_default; } $smarty->assign('category', $category); $controller = new FrontController(); $controller->displayHeader(); Jednak w header.tpl nie odbiera zmiennej {$category}. W czym jest problem? PS. Moja wersja presty to 1.4.1 Edited February 4, 2014 by 1q2w3e4r (see edit history) Link to comment Share on other sites More sharing options...
0 vekia Posted February 4, 2014 Share Posted February 4, 2014 a czy tę zmienną $category przekazałeś do tablicy smarty? Link to comment Share on other sites More sharing options...
0 1q2w3e4r Posted February 5, 2014 Author Share Posted February 5, 2014 tak, jest wyżej w przykładzie: $smarty->assign('category', $category); Link to comment Share on other sites More sharing options...
Question
1q2w3e4r
Chcę w header.tpl odbierać z adresu strony id kategorii oraz id produktu. Zrobiłem to tak, że dodałem do header.php taki kod:
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now