Document.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * 系统文章
  4. */
  5. namespace app\home\controller;
  6. use think\facade\View;
  7. use think\facade\Lang;
  8. /**
  9. * ============================================================================
  10. *
  11. * ============================================================================
  12. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  13. * 网站地址: https://www.valimart.net/
  14. * ----------------------------------------------------------------------------
  15. *
  16. * ============================================================================
  17. * 控制器
  18. */
  19. class Document extends BaseMall {
  20. public function initialize() {
  21. parent::initialize();
  22. Lang::load(base_path() . 'home/lang/'.config('lang.default_lang').'/index.lang.php');
  23. }
  24. public function index() {
  25. $code = input('param.code');
  26. if ($code == '') {
  27. $this->error(lang('param_error'));//'缺少参数:文章标识'
  28. }
  29. $document_model = model('document');
  30. $doc = $document_model->getOneDocumentByCode($code);
  31. View::assign('doc', $doc);
  32. /**
  33. * 分类导航
  34. */
  35. $nav_link = array(
  36. array(
  37. 'title' => lang('homepage'),
  38. 'link' => HOME_SITE_URL
  39. ),
  40. array(
  41. 'title' => $doc['document_title']
  42. )
  43. );
  44. View::assign('nav_link_list', $nav_link);
  45. return View::fetch($this->template_dir . 'index');
  46. }
  47. }
  48. ?>