ILIAS  release_8 Revision v8.23
ToastFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
31 {
33 
34  public function __construct(ToastRendererFactory $renderer_factory)
35  {
36  $this->renderer_factory = $renderer_factory;
37  }
38 
54  public function standard(
55  IdentificationInterface $identification,
56  string $title,
57  ?Icon $icon = null
59  return new StandardToastItem(
60  $identification,
61  $this->renderer_factory->getRenderer(StandardToastItem::class),
62  $title,
63  $icon
64  );
65  }
66 
73  public function action(string $identifier, string $title, \Closure $action): ToastAction
74  {
75  return new ToastAction($identifier, $title, $action);
76  }
77 }
This describes how an icon could be modified during construction of UI.
Definition: Icon.php:28
action(string $identifier, string $title, \Closure $action)
A ToastAction leads into the rendered toast to a link that can be clicked by the user.
standard(IdentificationInterface $identification, string $title, ?Icon $icon=null)
Your Toasts shiuld provide Callables which are executed on some events: onShow, onClose, onVanish.
__construct(ToastRendererFactory $renderer_factory)