Lines Matching refs:template

22  * This class is an implementation detail of how template compilation currently
59 * Returns the template name.
61 * @return string The template name
66 * Returns debug information about the template.
73 * Returns information about the original template source code.
83 * Returns the parent template.
88 * @return Template|TemplateWrapper|false The parent template or false if there is no parent
147 throw new RuntimeError(sprintf('The template has no parent and no traits defining the "%s" block.', $name), -1, $this->getSourceContext());
165 $template = $blocks[$name][0];
168 $template = $this->blocks[$name][0];
171 $template = null;
176 if (null !== $template && !$template instanceof self) {
180 if (null !== $template) {
182 $template->$block($context, $blocks);
185 $e->setSourceContext($template->getSourceContext());
196 $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
204 throw new RuntimeError(sprintf('Block "%s" should not call parent() in "%s" as the block does not exist in the parent template "%s".', $name, $blocks[$name][0]->getTemplateName(), $this->getTemplateName()), -1, $blocks[$name][0]->getSourceContext());
206 throw new RuntimeError(sprintf('Block "%s" on template "%s" does not exist.', $name, $this->getTemplateName()), -1, ($templateContext ?? $this)->getSourceContext());
260 * Returns whether a block exists or not in the current context of the template.
262 * This method checks blocks defined in the current template
289 * Returns all block names in the current context of the template.
291 * This method checks blocks defined in the current template
313 protected function loadTemplate($template, $templateName = null, $line = null, $index = null)
316 if (\is_array($template)) {
317 return $this->env->resolveTemplate($template);
320 if ($template instanceof self || $template instanceof TemplateWrapper) {
321 return $template;
324 if ($template === $this->getTemplateName()) {
330 return $this->env->loadClass($class, $template, $index);
333 return $this->env->loadTemplate($template, $index);
419 $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
427 * Auto-generated method to display the template with the given context.
429 * @param array $context An array of parameters to pass to the template
430 * @param array $blocks An array of blocks to pass to the template