ILIAS  release_8 Revision v8.23
ilTemplateWrapper.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 
24 use ilTemplate;
25 
29 class ilTemplateWrapper implements Template
30 {
32  private ilTemplate $tpl;
33 
34  final public function __construct(ilGlobalTemplateInterface $global_tpl, ilTemplate $tpl)
35  {
36  $this->global_tpl = $global_tpl;
37  $this->tpl = $tpl;
38  }
39 
43  public function setCurrentBlock(string $name): bool
44  {
45  return $this->tpl->setCurrentBlock($name);
46  }
47 
51  public function parseCurrentBlock(): bool
52  {
53  return $this->tpl->parseCurrentBlock();
54  }
55 
59  public function touchBlock(string $name): bool
60  {
61  return $this->tpl->touchBlock($name);
62  }
63 
67  public function setVariable(string $name, $value): void
68  {
69  $this->tpl->setVariable($name, $value);
70  }
71 
75  public function get(string $block = null): string
76  {
77  if ($block === null) {
78  $block = "__global__";
79  }
80  return $this->tpl->get($block);
81  }
82 
86  public function addOnLoadCode(string $code): void
87  {
88  $this->global_tpl->addOnLoadCode($code);
89  }
90 }
if($format !==null) $name
Definition: metadata.php:247
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Wraps an ilTemplate to only provide smaller interface.
__construct(ilGlobalTemplateInterface $global_tpl, ilTemplate $tpl)