Document.php 1.2 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. *
  13. * 控制器
  14. */
  15. class Document extends BaseMall
  16. {
  17. public function initialize()
  18. {
  19. parent::initialize();
  20. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/index.lang.php');
  21. }
  22. public function index()
  23. {
  24. $code = input('param.code');
  25. if ($code == '') {
  26. $this->error(lang('param_error')); //'缺少参数:文章标识'
  27. }
  28. $document_model = model('document');
  29. $doc = $document_model->getOneDocumentByCode($code);
  30. View::assign('doc', $doc);
  31. /**
  32. * 分类导航
  33. */
  34. $nav_link = array(
  35. array(
  36. 'title' => lang('homepage'),
  37. 'link' => HOME_SITE_URL
  38. ),
  39. array(
  40. 'title' => $doc['document_title']
  41. )
  42. );
  43. View::assign('nav_link_list', $nav_link);
  44. return View::fetch($this->template_dir . 'index');
  45. }
  46. }