请教这样操作为什么出错!
控制器:app/admin/controller/Buildhtml
// 生成sitemap
public function sitemap()
{
if ($this->request->isPost()) {
$content = action('index/sitemap/index'); // 直接调用index模块sitemap的index方法
file_put_contents(ROOT_PATH . '/public/sitemap.html', $content);
$this->success('页面生成成功!');
}
return $this->fetch();
}
控制器:app/index/controller/Sitemap
// sitemap
public function index() {
// 数据调用赋值等等...
return $this->fetch();
}
产生错误:
模板文件不存在:/home/wwwroot/xxxx.com/public/../application/index/view/public/message.html
这个提示页面只有后台有,前台只是简单展示,根本没有的。按理说后台操作,应该success调用后台的啊
有点懵比,请大侠看看什么原因!我哪里理解错了???
版本5.0.24
最佳答案
