Fix #241 Do not render if layout are from some specific ones

This commit is contained in:
Tomo Tsuyuki
2021-03-04 11:43:33 +11:00
parent f40f52bdc3
commit a6bb7f4bc2
3 changed files with 56 additions and 1 deletions

View File

@@ -66,6 +66,13 @@ class renderer extends plugin_renderer_base {
* @return string The rendered view code.
*/
public function render_view($view, $viewbag = []) {
// Do not render if the request are from some layouts.
$excludelayout = ['embedded', 'popup', 'secure', 'maintenance'];
if (in_array($this->page->pagelayout, $excludelayout)) {
return '';
}
ob_start();
$this->output_view($view, $viewbag);
$html = ob_get_contents();