123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace app;
- use think\App;
- use think\View;
- class PluginsBase extends BaseController
- {
- public ?View $view = null;
- function __construct(App $app)
- {
- parent::__construct($app);
- $this->_initialize();
- }
- function _initialize()
- {
- $this->view = new View($this->app);
- }
- function assign($key, $view)
- {
- $this->view->assign($key, $view);
- }
- function fetch($view, $opt = []): string
- {
- $view = plugins_path("view/" . $view);
- return $this->view->fetch($view, $opt);
- }
- }
|