Skip to content
New issue

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

插件视图模板路径问题 #14

Open
mini-content opened this issue Nov 4, 2020 · 0 comments
Open

插件视图模板路径问题 #14

mini-content opened this issue Nov 4, 2020 · 0 comments

Comments

@mini-content
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant