thinkphp 临时关闭布局,ajax只输出主题部分

https://www.kancloud.cn/manual/thinkphp5/125013

$this->view->engine->layout(false);//临时关闭模板布局,这些fetch出来的就不会带layout/default.html里的内容了

3种方式。如果当前方法命名和html位置不一致,推荐用第2中方式

1:return $this->view->fetch('orders/section/goods_item');//这个不行

2:return $this->view->fetch(APP_PATH.'/admin/view/orders/section/goods_item.html');//行

3:return $this->view->fetch();//行,但是必须得有对应路径的hrtml

原文地址:https://www.cnblogs.com/showker/p/13583018.html