SearchController.php 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 老猫 <thinkcmf@126.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\portal\controller;
  12. use cmf\controller\HomeBaseController;
  13. class SearchController extends HomeBaseController
  14. {
  15. /**
  16. * 搜索
  17. * @return mixed
  18. */
  19. public function index()
  20. {
  21. $keyword = $this->request->param('keyword');
  22. if (empty($keyword)) {
  23. $this -> error("关键词不能为空!请重新输入!");
  24. }
  25. $this -> assign("keyword", $keyword);
  26. return $this->fetch('/search');
  27. }
  28. }