Lines Matching refs:name

290      * @param string   $name  The name for which to calculate the template class name
297 public function getTemplateClass($name, $index = null) argument
299 $key = $this->getLoader()->getCacheKey($name).$this->optionsHash;
307 * @param string|TemplateWrapper $name The template name
316 public function render($name, array $context = []) argument
318 return $this->load($name)->render($context);
324 * @param string|TemplateWrapper $name The template name
331 public function display($name, array $context = []) argument
333 $this->load($name)->display($context);
339 * @param string|TemplateWrapper $name The template name
347 public function load($name) argument
349 if ($name instanceof TemplateWrapper) {
350 return $name;
353 if ($name instanceof Template) {
356 return new TemplateWrapper($this, $name);
359 return new TemplateWrapper($this, $this->loadTemplate($name));
368 * @param string $name The template name
379 public function loadTemplate($name, $index = null) argument
381 return $this->loadClass($this->getTemplateClass($name), $name, $index);
387 public function loadClass($cls, $name, $index = null) argument
399 $key = $this->cache->generateKey($name, $mainCls);
401 … if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
407 $source = $this->getLoader()->getSourceContext($name);
422 …iled to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $sour…
439 * @param string $name An optional name of the template to be used in error messages
446 public function createTemplate($template, string $name = null) argument
449 if (null !== $name) {
450 $name = sprintf('%s (string template %s)', $name, $hash);
452 $name = sprintf('__string_template__%s', $hash);
456 new ArrayLoader([$name => $template]),
462 return new TemplateWrapper($this, $this->loadTemplate($name));
475 * @param string $name The template name
480 public function isTemplateFresh($name, $time) argument
482 …return $this->extensionSet->getLastModified() <= $time && $this->getLoader()->isFresh($name, $time…
505 foreach ($names as $name) {
506 if ($name instanceof Template) {
507 return $name;
509 if ($name instanceof TemplateWrapper) {
510 return $name;
513 if (1 !== $count && !$this->getLoader()->exists($name)) {
517 return $this->loadTemplate($name);
788 * @param string $name The filter name
794 public function getFilter($name) argument
796 return $this->extensionSet->getFilter($name);
840 * @param string $name The test name
846 public function getTest($name) argument
848 return $this->extensionSet->getTest($name);
862 * @param string $name function name
868 public function getFunction($name) argument
870 return $this->extensionSet->getFunction($name);
900 * @param string $name The global name
903 public function addGlobal($name, $value) argument
905 … if ($this->extensionSet->isInitialized() && !\array_key_exists($name, $this->getGlobals())) {
906 …nable to add global "%s" as the runtime or the extensions have already been initialized.', $name));
910 $this->resolvedGlobals[$name] = $value;
912 $this->globals[$name] = $value;