Category.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. *
  7. *
  8. * ----------------------------------------------------------------------------
  9. *
  10. * 控制器
  11. */
  12. class Category extends BaseMall
  13. {
  14. public function initialize()
  15. {
  16. parent::initialize();
  17. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/category.lang.php');
  18. }
  19. /*
  20. * 显示商品分类列表
  21. */
  22. public function goods()
  23. {
  24. //获取全部的商品分类
  25. //导航
  26. $nav_link = array(
  27. '0' => array('title' => lang('homepage'), 'link' => HOME_SITE_URL),
  28. '1' => array('title' => lang('category_index_goods_class'))
  29. );
  30. View::assign('nav_link_list', $nav_link);
  31. View::assign('html_title', config('ds_config.site_name') . ' - ' . lang('category_index_goods_class'));
  32. return View::fetch($this->template_dir . 'goods_category');
  33. }
  34. /*
  35. * 显示店铺分类列表
  36. */
  37. public function store()
  38. {
  39. //导航
  40. $nav_link = array(
  41. '0' => array('title' => lang('homepage'), 'link' => HOME_SITE_URL),
  42. '1' => array('title' => lang('category_index_store_class'))
  43. );
  44. View::assign('nav_link_list', $nav_link);
  45. $sc_list = model('storeclass')->getStoreclassList();
  46. View::assign('sc_list', $sc_list);
  47. return View::fetch($this->template_dir . 'store_category');
  48. }
  49. }