PluginController.php 1.0 KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +---------------------------------------------------------------------
  9. // | Author: Dean <zxxjjforever@163.com>
  10. // +----------------------------------------------------------------------
  11. namespace cmf\controller;
  12. use think\App;
  13. use think\Loader;
  14. class PluginController extends HomeBaseController
  15. {
  16. public function index($_plugin, $_controller, $_action)
  17. {
  18. $_controller = Loader::parseName($_controller, 1);
  19. $pluginControllerClass = "plugins\\{$_plugin}\\controller\\{$_controller}Controller";;
  20. $vars = [];
  21. return App::invokeMethod([$pluginControllerClass, $_action, $vars]);
  22. }
  23. }