protected function collectJsTemplates($except = []) { $view = $this->context->getView(); $output = []; if (is_array($view->js) && array_key_exists(View::POS_READY, $view->js)) { foreach ($view->js[View::POS_READY] as $key => $js) { if (array_key_exists($key, $except)) { continue; } if (preg_match('/^[^{]+{multiple-index}.*$/m', $js) === 1) { $output[$key] = $js; unset($view->js[View::POS_READY][$key]); } } } return $output; }