19declare(strict_types=1);
39 protected array $contexts,
40 protected array $context_parameter,
49 $clone->contexts[] = $context;
53 public function __isset(
string $name): bool
55 foreach ($this->contexts as $context) {
56 $possible_placeholder = array_map(
57 static function ($placeholder):
string {
58 return strtoupper($placeholder);
60 array_keys($context->getPlaceholders())
62 if (\in_array($name, $possible_placeholder,
true)) {
70 public function __get(
string $name): string
72 foreach ($this->contexts as $context) {
73 $ret = $context->resolvePlaceholder($name, $this->context_parameter, $this->recipient);
74 if (\in_array($name, $context->getNestedPlaceholders(),
true)) {
75 $ret = $this->template_engine->render($ret, $this);
82 if ($this->recipient ===
null) {
83 foreach ($this->contexts as $context) {
84 if ($context->requiresRecipientByPlaceholderName($name)) {
This class forms an interface between the existing ILIAS mail contexts and the requirements of the te...
withContext(ilMailTemplateContext $context)
__construct()
Constructor setup ILIAS global object @access public.
Interface for template engine functionality used in Mail and related components.