We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tp6框架下使用时会出现路径问题,会由原来的addons下插件内的view文件夹变成根目录下的view文件夹 暂时的解决方案: /** * 插件构造函数 * Addons constructor. * @param \think\App $app */ public function __construct(App $app) { $this->app = $app; $this->request = $app->request; $this->name = $this->getName(); $this->addon_path = $app->addons->getAddonsPath() . $this->name . DIRECTORY_SEPARATOR; $this->addon_config = "addon_{$this->name}_config"; $this->addon_info = "addon_{$this->name}_info"; $this->view = clone View::engine('Think'); $this->view->config([ 'view_path' => $this->addon_path . 'view' . DIRECTORY_SEPARATOR ]); // 控制器初始化 $this->initialize(); } 去除此段代码内的 clone
/** * 插件构造函数 * Addons constructor. * @param \think\App $app */ public function __construct(App $app) { $this->app = $app; $this->request = $app->request; $this->name = $this->getName(); $this->addon_path = $app->addons->getAddonsPath() . $this->name . DIRECTORY_SEPARATOR; $this->addon_config = "addon_{$this->name}_config"; $this->addon_info = "addon_{$this->name}_info"; $this->view = clone View::engine('Think'); $this->view->config([ 'view_path' => $this->addon_path . 'view' . DIRECTORY_SEPARATOR ]); // 控制器初始化 $this->initialize(); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
tp6框架下使用时会出现路径问题,会由原来的addons下插件内的view文件夹变成根目录下的view文件夹
暂时的解决方案:
/** * 插件构造函数 * Addons constructor. * @param \think\App $app */ public function __construct(App $app) { $this->app = $app; $this->request = $app->request; $this->name = $this->getName(); $this->addon_path = $app->addons->getAddonsPath() . $this->name . DIRECTORY_SEPARATOR; $this->addon_config = "addon_{$this->name}_config"; $this->addon_info = "addon_{$this->name}_info"; $this->view = clone View::engine('Think'); $this->view->config([ 'view_path' => $this->addon_path . 'view' . DIRECTORY_SEPARATOR ]); // 控制器初始化 $this->initialize(); }
去除此段代码内的 clone
The text was updated successfully, but these errors were encountered: